mirror of
https://github.com/4gray/iptvnator.git
synced 2026-10-12 20:16:15 -08:00
test: migrate from karma to jest
This commit is contained in:
1 parent
ec8871189a
commit
f778e1d9d8
8 files changed
+4949
-111
No files matched your search
+1
-21
@@ -104,26 +104,6 @@
|
||||
"browserTarget": "angular-electron:build"
|
||||
}
|
||||
},
|
||||
"test": {
|
||||
"builder": "@angular-builders/custom-webpack:karma",
|
||||
"options": {
|
||||
"main": "src/test.ts",
|
||||
"polyfills": "src/polyfills-test.ts",
|
||||
"tsConfig": "src/tsconfig.spec.json",
|
||||
"karmaConfig": "src/karma.conf.js",
|
||||
"scripts": [],
|
||||
"styles": [
|
||||
"src/styles.scss"
|
||||
],
|
||||
"assets": [
|
||||
"src/assets"
|
||||
],
|
||||
"customWebpackConfig": {
|
||||
"path": "./angular.webpack.js",
|
||||
"target": "electron-renderer"
|
||||
}
|
||||
}
|
||||
},
|
||||
"lint": {
|
||||
"builder": "@angular-eslint/builder:lint",
|
||||
"options": {
|
||||
@@ -168,4 +148,4 @@
|
||||
"prefix": "app"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Generated
+4918
-1
File diff suppressed because it is too large.
Load diff
+18
-1
@@ -62,6 +62,7 @@
|
||||
"@semantic-release/git": "9.0.0",
|
||||
"@types/jasmine": "3.5.11",
|
||||
"@types/jasminewd2": "2.0.8",
|
||||
"@types/jest": "26.0.14",
|
||||
"@types/mocha": "7.0.2",
|
||||
"@types/node": "12.12.6",
|
||||
"@typescript-eslint/eslint-plugin": "3.6.0",
|
||||
@@ -78,12 +79,15 @@
|
||||
"eslint-plugin-import": "2.22.0",
|
||||
"jasmine-core": "3.5.0",
|
||||
"jasmine-spec-reporter": "5.0.2",
|
||||
"jest": "26.4.2",
|
||||
"jest-preset-angular": "8.3.1",
|
||||
"karma": "5.1.0",
|
||||
"karma-coverage-istanbul-reporter": "3.0.3",
|
||||
"karma-electron": "6.3.0",
|
||||
"karma-jasmine": "3.3.1",
|
||||
"karma-jasmine-html-reporter": "1.5.4",
|
||||
"mocha": "7.2.0",
|
||||
"ng-mocks": "10.1.3",
|
||||
"npm-run-all": "4.1.5",
|
||||
"rxjs": "6.6.0",
|
||||
"semantic-release": "17.1.1",
|
||||
@@ -121,5 +125,18 @@
|
||||
"ngx-uploader": "10.0.0",
|
||||
"uuid": "8.3.0",
|
||||
"video-js": "0.7.0"
|
||||
},
|
||||
"jest": {
|
||||
"preset": "jest-preset-angular",
|
||||
"setupFilesAfterEnv": [
|
||||
"<rootDir>/src/setupJest.ts"
|
||||
],
|
||||
"testMatch": [
|
||||
"**/+(*.)+(spec|test).+(ts)?(x)"
|
||||
],
|
||||
"coverageReporters": [
|
||||
"html",
|
||||
"lcov"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,44 +0,0 @@
|
||||
// Karma configuration file, see link for more information
|
||||
// https://karma-runner.github.io/0.13/config/configuration-file.html
|
||||
|
||||
module.exports = function (config) {
|
||||
config.set({
|
||||
basePath: '',
|
||||
frameworks: ['jasmine', '@angular-devkit/build-angular'],
|
||||
plugins: [
|
||||
require('karma-jasmine'),
|
||||
require('karma-electron'),
|
||||
require('karma-jasmine-html-reporter'),
|
||||
require('karma-coverage-istanbul-reporter'),
|
||||
require('@angular-devkit/build-angular/plugins/karma')
|
||||
],
|
||||
client:{
|
||||
clearContext: false // leave Jasmine Spec Runner output visible in browser
|
||||
},
|
||||
coverageIstanbulReporter: {
|
||||
dir: require('path').join(__dirname, '../coverage'),
|
||||
reports: [ 'html', 'lcovonly' ],
|
||||
fixWebpackSourcePaths: true
|
||||
},
|
||||
reporters: ['progress', 'kjhtml'],
|
||||
port: 9876,
|
||||
colors: true,
|
||||
logLevel: config.LOG_INFO,
|
||||
browsers: ['AngularElectron'],
|
||||
customLaunchers: {
|
||||
AngularElectron: {
|
||||
base: 'Electron',
|
||||
flags: [
|
||||
'--remote-debugging-port=9222'
|
||||
],
|
||||
browserWindowOptions: {
|
||||
webPreferences: {
|
||||
nodeIntegration: true,
|
||||
nodeIntegrationInSubFrames: true,
|
||||
allowRunningInsecureContent: true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
@@ -0,0 +1 @@
|
||||
import 'jest-preset-angular';
|
||||
-20
@@ -1,20 +0,0 @@
|
||||
// This file is required by karma.conf.js and loads recursively all the .spec and framework files
|
||||
|
||||
import 'zone.js/dist/zone-testing';
|
||||
import { getTestBed } from '@angular/core/testing';
|
||||
import {
|
||||
BrowserDynamicTestingModule,
|
||||
platformBrowserDynamicTesting
|
||||
} from '@angular/platform-browser-dynamic/testing';
|
||||
|
||||
declare const require: any;
|
||||
|
||||
// First, initialize the Angular testing environment.
|
||||
getTestBed().initTestEnvironment(
|
||||
BrowserDynamicTestingModule,
|
||||
platformBrowserDynamicTesting()
|
||||
);
|
||||
// Then we find all the tests.
|
||||
const context = require.context('./', true, /\.spec\.ts$/);
|
||||
// And load the modules.
|
||||
context.keys().map(context);
|
||||
@@ -1,24 +0,0 @@
|
||||
{
|
||||
"extends": "../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "../out-tsc/spec",
|
||||
"module": "commonjs",
|
||||
"types": [
|
||||
"jasmine",
|
||||
"node"
|
||||
]
|
||||
},
|
||||
"files": [
|
||||
"test.ts",
|
||||
"polyfills-test.ts"
|
||||
],
|
||||
"include": [
|
||||
"**/*.spec.ts",
|
||||
"**/*.d.ts"
|
||||
],
|
||||
"exclude": [
|
||||
"dist",
|
||||
"release",
|
||||
"node_modules"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"extends": "./tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "../out-tsc/spec",
|
||||
"baseUrl": "./",
|
||||
"types": ["jest", "node"],
|
||||
"experimentalDecorators": true
|
||||
},
|
||||
"files": ["src/polyfills.ts"],
|
||||
"include": ["**/*.spec.ts", "**/*.d.ts"]
|
||||
}
|
||||
Reference in new issue
Block a user