11module . exports = function ( config ) {
2+ var gulpConfig = require ( './gulp.config' ) ( ) ;
23 var dependencies = require ( './package.json' ) . dependencies ;
34 var excludedDependencies = [
45 'systemjs' , 'zone.js' , 'font-awesome'
56 ] ;
67 var configuration = {
7- basePath : '' ,
8+ basePath : './ ' ,
89
910 frameworks : [ 'jasmine' ] ,
1011 browsers : [ 'PhantomJS' ] ,
1112 reporters : [ 'progress' , 'coverage' ] ,
1213
13- preprocessors : {
14- 'tmp/app/**/!(*.spec)+(.js)' : [ 'coverage' ] ,
15- 'tmp/app/**/*.js' : [ 'sourcemap' ] ,
16- 'tmp/test/**/*.js' : [ 'sourcemap' ]
17- } ,
14+ preprocessors : { } ,
1815
1916 // Generate json used for remap-istanbul
2017 coverageReporter : {
@@ -26,38 +23,20 @@ module.exports = function(config) {
2623
2724 files : [
2825 'node_modules/traceur/bin/traceur-runtime.js' ,
29- // IE required polyfills, in this exact order
3026 'node_modules/es6-shim/es6-shim.min.js' ,
3127 'node_modules/systemjs/dist/system-polyfills.js' ,
3228 'node_modules/zone.js/dist/zone.js' ,
3329 'node_modules/reflect-metadata/Reflect.js' ,
3430 'node_modules/zone.js/dist/async-test.js' ,
3531 'node_modules/zone.js/dist/fake-async-test.js' ,
36- 'node_modules/systemjs/dist/system.src.js' ,
37-
38- 'tmp/test/test-helpers/global/**/*.js' ,
39- 'systemjs.conf.js' ,
40- 'karma-test-shim.js' ,
41-
42- { pattern : 'tmp/app/**/*.js' , included : false } ,
43- { pattern : 'tmp/test/test-helpers/*.js' , included : false } ,
44-
45- // paths loaded via Angular's component compiler
46- // (these paths need to be rewritten, see proxies section)
47- { pattern : 'app/**/*.html' , included : false } ,
48- { pattern : 'app/**/*.css' , included : false } ,
49-
50- // paths to support debugging with source maps in dev tools
51- { pattern : 'app/**/*.ts' , included : false , watched : false } ,
52- { pattern : 'tmp/app/**/*.js.map' , included : false , watched : false }
32+ 'node_modules/systemjs/dist/system.src.js'
5333 ] ,
5434
5535 // proxied base paths
5636 proxies : {
5737 // required for component assests fetched by Angular's compiler
58- "/app/" : "/base/app/" ,
59- "/tmp/app/" : "/base/tmp/app/" ,
60- "/tmp/test/" : "/base/tmp/test/" ,
38+ "/app/" : "/base/src/app/" ,
39+ "/tmp/" : "/base/src/tmp/" ,
6140 "/node_modules/" : "/base/node_modules/"
6241 } ,
6342
@@ -67,6 +46,24 @@ module.exports = function(config) {
6746 autoWatch : true ,
6847 } ;
6948
49+ configuration . preprocessors [ gulpConfig . tmpApp + '**/!(*.spec)+(.js)' ] = [ 'coverage' ] ;
50+ configuration . preprocessors [ gulpConfig . tmpApp + '**/*.js' ] = [ 'sourcemap' ] ;
51+ configuration . preprocessors [ gulpConfig . tmpTest + '**/*.js' ] = [ 'sourcemap' ] ;
52+
53+ var files = [
54+ gulpConfig . tmpTest + 'test-helpers/global/**/*.js' ,
55+ gulpConfig . src + 'systemjs.conf.js' ,
56+ 'karma-test-shim.js' ,
57+ createFilePattern ( gulpConfig . tmpApp + '**/*.js' , { included : false } ) ,
58+ createFilePattern ( gulpConfig . tmpTest + 'test-helpers/*.js' , { included : false } ) ,
59+ createFilePattern ( gulpConfig . app + '**/*.html' , { included : false } ) ,
60+ createFilePattern ( gulpConfig . app + '**/*.css' , { included : false } ) ,
61+ createFilePattern ( gulpConfig . app + '**/*.ts' , { included : false , watched : false } ) ,
62+ createFilePattern ( gulpConfig . tmpApp + '**/*.js.map' , { included : false , watched : false } )
63+ ] ;
64+
65+ configuration . files = configuration . files . concat ( files ) ;
66+
7067 Object . keys ( dependencies ) . forEach ( function ( key ) {
7168 if ( excludedDependencies . indexOf ( key ) >= 0 ) { return ; }
7269
@@ -84,4 +81,10 @@ module.exports = function(config) {
8481 }
8582
8683 config . set ( configuration ) ;
84+
85+ // Helpers
86+ function createFilePattern ( path , config ) {
87+ config . pattern = path ;
88+ return config ;
89+ }
8790}
0 commit comments