1- // #docregion
21module . exports = function ( config ) {
32
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
65 var appAssets = 'base/app/' ; // component assets fetched by Angular's compiler
76
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
109
1110 config . set ( {
1211 basePath : '' ,
1312 frameworks : [ 'jasmine' ] ,
13+
1414 plugins : [
1515 require ( 'karma-jasmine' ) ,
1616 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
1918 ] ,
2019
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+
2125 customLaunchers : {
2226 // From the CLI. Not used here but interesting
2327 // chrome setup for travis CI using chromium
@@ -26,6 +30,7 @@ module.exports = function(config) {
2630 flags : [ '--no-sandbox' ]
2731 }
2832 } ,
33+
2934 files : [
3035 // System.js for module loading
3136 'node_modules/systemjs/dist/system.src.js' ,
@@ -54,11 +59,11 @@ module.exports = function(config) {
5459
5560 { pattern : 'systemjs.config.js' , included : false , watched : false } ,
5661 { 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
5863
5964 // transpiled application & spec code paths loaded via module imports
6065 { pattern : appBase + '**/*.js' , included : false , watched : true } ,
61- { pattern : testBase + '**/*.js' , included : false , watched : true } ,
66+ { pattern : testingBase + '**/*.js' , included : false , watched : true } ,
6267
6368
6469 // Asset (HTML & CSS) paths loaded via Angular's component compiler
@@ -69,8 +74,8 @@ module.exports = function(config) {
6974 // Paths for debugging with source maps in dev tools
7075 { pattern : appSrcBase + '**/*.ts' , included : false , watched : false } ,
7176 { 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 }
7479 ] ,
7580
7681 // Proxied base paths for loading assets
@@ -81,18 +86,7 @@ module.exports = function(config) {
8186
8287 exclude : [ ] ,
8388 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' ] ,
9690
9791 port : 9876 ,
9892 colors : true ,
0 commit comments