1
1
// #docregion
2
2
module . exports = function ( config ) {
3
3
4
- var appBase = 'app/' ; // transpiled app JS and map files
5
- var appSrcBase = 'app/' ; // app source TS files
4
+ var appBase = 'app/' ; // transpiled app JS and map files
5
+ var appSrcBase = 'app/' ; // app source TS files
6
6
var appAssets = 'base/app/' ; // component assets fetched by Angular's compiler
7
7
8
- var testBase = 'testing/' ; // transpiled test JS and map files
9
- var testSrcBase = 'testing/' ; // test source TS files
8
+ var testingBase = 'testing/' ; // transpiled test JS and map files
9
+ var testingSrcBase = 'testing/' ; // test source TS files
10
10
11
11
config . set ( {
12
12
basePath : '' ,
13
13
frameworks : [ 'jasmine' ] ,
14
+
14
15
plugins : [
15
16
require ( 'karma-jasmine' ) ,
16
17
require ( 'karma-chrome-launcher' ) ,
17
- require ( 'karma-jasmine-html-reporter' ) , // click "Debug" in browser to see it
18
- require ( 'karma-htmlfile-reporter' ) // crashing w/ strange socket error
18
+ require ( 'karma-jasmine-html-reporter' )
19
19
] ,
20
20
21
+ client : {
22
+ builtPaths : [ appSrcBase , testingBase ] , // add more spec base paths as needed
23
+ clearContext : false // leave Jasmine Spec Runner output visible in browser
24
+ } ,
25
+
21
26
customLaunchers : {
22
27
// From the CLI. Not used here but interesting
23
28
// chrome setup for travis CI using chromium
@@ -26,6 +31,7 @@ module.exports = function(config) {
26
31
flags : [ '--no-sandbox' ]
27
32
}
28
33
} ,
34
+
29
35
files : [
30
36
// System.js for module loading
31
37
'node_modules/systemjs/dist/system.src.js' ,
@@ -49,28 +55,28 @@ module.exports = function(config) {
49
55
50
56
// Paths loaded via module imports:
51
57
// Angular itself
52
- { pattern : 'node_modules/@angular/**/*.js' , included : false , watched : false } ,
53
- { pattern : 'node_modules/@angular/**/*.js.map' , included : false , watched : false } ,
58
+ { pattern : 'node_modules/@angular/**/*.js' , included : false , watched : false } ,
59
+ { pattern : 'node_modules/@angular/**/*.js.map' , included : false , watched : false } ,
54
60
55
- { pattern : 'systemjs.config.js' , included : false , watched : false } ,
56
- { pattern : 'systemjs.config.extras.js' , included : false , watched : false } ,
57
- 'karma-test-shim.js' ,
61
+ { pattern : 'systemjs.config.js' , included : false , watched : false } ,
62
+ { pattern : 'systemjs.config.extras.js' , included : false , watched : false } ,
63
+ 'karma-test-shim.js' , // optionally extend SystemJS mapping e.g., with barrels
58
64
59
65
// transpiled application & spec code paths loaded via module imports
60
- { pattern : appBase + '**/*.js' , included : false , watched : true } ,
61
- { pattern : testBase + '**/*.js' , included : false , watched : true } ,
66
+ { pattern : appBase + '**/*.js' , included : false , watched : true } ,
67
+ { pattern : testingBase + '**/*.js' , included : false , watched : true } ,
62
68
63
69
64
70
// Asset (HTML & CSS) paths loaded via Angular's component compiler
65
71
// (these paths need to be rewritten, see proxies section)
66
- { pattern : appBase + '**/*.html' , included : false , watched : true } ,
67
- { pattern : appBase + '**/*.css' , included : false , watched : true } ,
72
+ { pattern : appBase + '**/*.html' , included : false , watched : true } ,
73
+ { pattern : appBase + '**/*.css' , included : false , watched : true } ,
68
74
69
75
// Paths for debugging with source maps in dev tools
70
- { pattern : appSrcBase + '**/*.ts' , included : false , watched : false } ,
71
- { pattern : appBase + '**/*.js.map' , included : false , watched : false } ,
72
- { pattern : testSrcBase + '**/*.ts' , included : false , watched : false } ,
73
- { pattern : testBase + '**/*.js.map' , included : false , watched : false }
76
+ { pattern : appSrcBase + '**/*.ts' , included : false , watched : false } ,
77
+ { pattern : appBase + '**/*.js.map' , included : false , watched : false } ,
78
+ { pattern : testingSrcBase + '**/*.ts' , included : false , watched : false } ,
79
+ { pattern : testingBase + '**/*.js.map' , included : false , watched : false }
74
80
] ,
75
81
76
82
// Proxied base paths for loading assets
@@ -81,18 +87,7 @@ module.exports = function(config) {
81
87
82
88
exclude : [ ] ,
83
89
preprocessors : { } ,
84
- // disabled HtmlReporter; suddenly crashing w/ strange socket error
85
- reporters : [ 'progress' , 'kjhtml' ] , //'html'],
86
-
87
- // HtmlReporter configuration
88
- htmlReporter : {
89
- // Open this file to see results in browser
90
- outputFile : '_test-output/tests.html' ,
91
-
92
- // Optional
93
- pageTitle : 'Unit Tests' ,
94
- subPageTitle : __dirname
95
- } ,
90
+ reporters : [ 'progress' , 'kjhtml' ] ,
96
91
97
92
port : 9876 ,
98
93
colors : true ,
0 commit comments