Skip to content

Commit 9869008

Browse files
committed
fix ng test in Docker DevContainer for issue #1
1 parent a2c907c commit 9869008

File tree

2 files changed

+51
-1
lines changed

2 files changed

+51
-1
lines changed

angular.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,8 @@
8989
"styles": [
9090
"src/styles.css"
9191
],
92-
"scripts": []
92+
"scripts": [],
93+
"karmaConfig": "karma.conf.js"
9394
}
9495
}
9596
}

karma.conf.js

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
// Karma configuration file, see link for more information
2+
// https://karma-runner.github.io/1.0/config/configuration-file.html
3+
4+
module.exports = function (config) {
5+
config.set({
6+
basePath: '',
7+
frameworks: ['jasmine', '@angular-devkit/build-angular'],
8+
plugins: [
9+
require('karma-jasmine'),
10+
require('karma-chrome-launcher'),
11+
require('karma-jasmine-html-reporter'),
12+
require('karma-coverage'),
13+
require('@angular-devkit/build-angular/plugins/karma')
14+
],
15+
client: {
16+
jasmine: {
17+
// you can add configuration options for Jasmine here
18+
// the possible options are listed at https://jasmine.github.io/api/edge/Configuration.html
19+
// for example, you can disable the random execution with `random: false`
20+
// or set a specific seed with `seed: 4321`
21+
},
22+
clearContext: false // leave Jasmine Spec Runner output visible in browser
23+
},
24+
jasmineHtmlReporter: {
25+
suppressAll: true // removes the duplicated traces
26+
},
27+
coverageReporter: {
28+
dir: require('path').join(__dirname, './coverage/angular-16-jwt-auth'),
29+
subdir: '.',
30+
reporters: [
31+
{ type: 'html' },
32+
{ type: 'text-summary' }
33+
]
34+
},
35+
reporters: ['progress', 'kjhtml'],
36+
// browsers: ['Chrome'],
37+
browsers: ['ChromeHeadlessNoSandbox'],
38+
customLaunchers: {
39+
ChromeHeadlessNoSandbox: {
40+
base: "ChromeHeadless",
41+
flags: [
42+
"--no-sandbox",
43+
"--disable-setuid-sandbox"
44+
]
45+
}
46+
},
47+
restartOnFileChange: true
48+
});
49+
};

0 commit comments

Comments
 (0)