From 31a7709ece43f0bafce3933381562fad4f041e3a Mon Sep 17 00:00:00 2001 From: Victor Berchet Date: Thu, 21 Jul 2016 16:12:40 -0700 Subject: [PATCH] test: execute router tests on .`/test.sh browser` (#10053) --- karma-js.conf.js | 1 + modules/@angular/router/karma.conf.js | 2 +- modules/tsconfig.json | 3 +-- tools/tsc-watch/index.ts | 19 ++++++++++++++++--- 4 files changed, 19 insertions(+), 6 deletions(-) diff --git a/karma-js.conf.js b/karma-js.conf.js index 884af2add8..47ebddc698 100644 --- a/karma-js.conf.js +++ b/karma-js.conf.js @@ -38,6 +38,7 @@ module.exports = function(config) { exclude: [ 'dist/all/@angular/**/e2e_test/**', 'dist/all/@angular/examples/**', + 'dist/all/@angular/router/**', 'dist/all/@angular/compiler-cli/**', 'dist/all/angular1_router.js', 'dist/all/@angular/platform-browser/testing/e2e_util.js' diff --git a/modules/@angular/router/karma.conf.js b/modules/@angular/router/karma.conf.js index a9e2219342..003b4cb3e6 100644 --- a/modules/@angular/router/karma.conf.js +++ b/modules/@angular/router/karma.conf.js @@ -77,5 +77,5 @@ module.exports = function(config) { autoWatch: true, browsers: ['Chrome'], singleRun: false - }) + }); }; \ No newline at end of file diff --git a/modules/tsconfig.json b/modules/tsconfig.json index 24b9b97e02..39a6902fc7 100644 --- a/modules/tsconfig.json +++ b/modules/tsconfig.json @@ -30,7 +30,6 @@ "rollup-test", "upgrade-ts2dart.d.ts", "zone-ts2dart.d.ts", - "@angular/compiler-cli/integrationtest", - "@angular/router" + "@angular/compiler-cli/integrationtest" ] } diff --git a/tools/tsc-watch/index.ts b/tools/tsc-watch/index.ts index 4b817fe8fb..dda662c06f 100644 --- a/tools/tsc-watch/index.ts +++ b/tools/tsc-watch/index.ts @@ -79,9 +79,20 @@ if (platform == 'node') { start: 'File change detected. Starting incremental compilation...', error: 'error', complete: 'Compilation complete. Watching for file changes.', - onStartCmds: - [['node', 'node_modules/karma/bin/karma', 'start', '--no-auto-watch', 'karma-js.conf.js']], - onChangeCmds: [['node', 'node_modules/karma/bin/karma', 'run', 'karma-js.conf.js']] + onStartCmds: [ + [ + 'node', 'node_modules/karma/bin/karma', 'start', '--no-auto-watch', '--port=9876', + 'karma-js.conf.js' + ], + [ + 'node', 'node_modules/karma/bin/karma', 'start', '--no-auto-watch', '--port=9877', + 'modules/@angular/router/karma.conf.js' + ], + ], + onChangeCmds: [ + ['node', 'node_modules/karma/bin/karma', 'run', 'karma-js.conf.js', '--port=9876'], + ['node', 'node_modules/karma/bin/karma', 'run', '--port=9877'], + ] }); } else if (platform == 'tools') { tscWatch = new TscWatch({ @@ -93,6 +104,8 @@ if (platform == 'node') { 'node', 'dist/tools/cjs-jasmine/index-tools', '--', '@angular/tsc-wrapped/**/*{_,.}spec.js' ]] }); +} else { + throw new Error(`unknown platform: ${platform}`); } if (runMode === 'watch') {