Skip to content
This repository was archived by the owner on Dec 18, 2024. It is now read-only.

Commit 5c86f57

Browse files
committed
Get unit tests running
1 parent 38428be commit 5c86f57

File tree

6 files changed

+5885
-6440
lines changed

6 files changed

+5885
-6440
lines changed

angular.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,9 @@
9999
"builder": "@angular-devkit/build-angular:karma",
100100
"options": {
101101
"main": "src/test.ts",
102+
"polyfills": "src/polyfills.ts",
102103
"karmaConfig": "./karma.conf.js",
103-
"tsConfig": "src/tsconfig.json",
104+
"tsConfig": "src/tsconfig.spec.json",
104105
"scripts": [],
105106
"styles": [
106107
{

karma.conf.js

Lines changed: 9 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// Karma configuration file, see link for more information
22
// https://karma-runner.github.io/0.13/config/configuration-file.html
33
const {customLaunchers, platformMap} = require('./browser-providers');
4-
const path = require('path');
54

65
module.exports = function (config) {
76
config.set({
@@ -10,34 +9,21 @@ module.exports = function (config) {
109
plugins: [
1110
require('karma-jasmine'),
1211
require('karma-chrome-launcher'),
13-
require('karma-remap-istanbul'),
12+
require('karma-jasmine-html-reporter'),
13+
require('karma-coverage-istanbul-reporter'),
1414
require('@angular-devkit/build-angular/plugins/karma'),
1515
require('karma-browserstack-launcher'),
1616
require('karma-sauce-launcher'),
1717
],
18-
files: [
19-
{pattern: './src/test.ts', watched: false},
20-
{pattern: 'node_modules/hammerjs/hammer.js', included: true, watched: false},
21-
],
22-
preprocessors: {
23-
'./src/test.ts': ['@angular-devkit/build-angular']
24-
},
25-
mime: {
26-
'text/x-typescript': ['ts','tsx']
27-
},
28-
remapIstanbulReporter: {
29-
dir: require('path').join(__dirname, 'coverage'), reports: {
30-
html: 'coverage',
31-
lcovonly: './coverage/coverage.lcov'
32-
}
18+
client: {
19+
clearContext: false // leave Jasmine Spec Runner output visible in browser
3320
},
34-
angularCli: {
35-
config: './angular-cli.json',
36-
environment: 'dev'
21+
coverageIstanbulReporter: {
22+
dir: require('path').join(__dirname, 'coverage'),
23+
reports: ['html', 'lcovonly'],
24+
fixWebpackSourcePaths: true
3725
},
38-
reporters: config.angularCli && config.angularCli.codeCoverage
39-
? ['dots', 'karma-remap-istanbul']
40-
: ['dots'],
26+
rreporters: ['progress', 'kjhtml'],
4127
port: 9876,
4228
colors: true,
4329
logLevel: config.LOG_INFO,

0 commit comments

Comments
 (0)