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