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
+ // Testing helpers (optional) are conventionally in a folder called `testing`
9
+ var testingBase = 'testing/' ; // transpiled test JS and map files
10
+ var testingSrcBase = 'testing/' ; // test source TS files
10
11
11
12
config . set ( {
12
13
basePath : '' ,
13
14
frameworks : [ 'jasmine' ] ,
15
+
14
16
plugins : [
15
17
require ( 'karma-jasmine' ) ,
16
18
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
19
+ require ( 'karma-jasmine-html-reporter' ) // click "Debug" in browser to see it
19
20
] ,
20
21
22
+ client : {
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' ,
@@ -58,7 +64,7 @@ module.exports = function(config) {
58
64
59
65
// transpiled application & spec code paths loaded via module imports
60
66
{ pattern : appBase + '**/*.js' , included : false , watched : true } ,
61
- { pattern : testBase + '**/*.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
@@ -69,8 +75,8 @@ module.exports = function(config) {
69
75
// Paths for debugging with source maps in dev tools
70
76
{ pattern : appSrcBase + '**/*.ts' , included : false , watched : false } ,
71
77
{ 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 }
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