Skip to content
This repository was archived by the owner on Feb 26, 2024. It is now read-only.

Commit c0604f5

Browse files
authored
fix: Run tests on both the build as well as the dist folder (#514)
1 parent 20b5a5d commit c0604f5

12 files changed

+73
-16
lines changed

.travis.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ before_script:
2222
- ./scripts/sauce/sauce_connect_block.sh
2323

2424
script:
25-
- node_modules/.bin/karma start karma-sauce-jasmine.conf.js --single-run
26-
- node_modules/.bin/karma start karma-sauce-mocha.conf.js --single-run
25+
- node_modules/.bin/gulp build
26+
- node_modules/.bin/karma start karma-dist-sauce-jasmine.conf.js --single-run
27+
- node_modules/.bin/karma start karma-build-sauce-mocha.conf.js --single-run
2728
- node_modules/.bin/gulp test/node

karma.conf.js renamed to karma-base.conf.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,7 @@ module.exports = function (config) {
1515
'node_modules/whatwg-fetch/fetch.js',
1616
{pattern: 'test/assets/**/*.*', watched: true, served: true, included: false},
1717
{pattern: 'build/**/*.js.map', watched: true, served: true, included: false},
18-
{pattern: 'build/**/*.js', watched: true, served: true, included: false},
19-
'build/test/wtf_mock.js',
20-
'build/lib/zone.js',
21-
'build/test/main.js'
18+
{pattern: 'build/**/*.js', watched: true, served: true, included: false}
2219
],
2320

2421
plugins: [

karma-build-jasmine.conf.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
2+
module.exports = function (config) {
3+
require('./karma-build.conf.js')(config);
4+
5+
config.plugins.push(require('karma-jasmine'));
6+
config.frameworks.push('jasmine');
7+
};

karma-build-mocha.conf.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
2+
module.exports = function (config) {
3+
require('./karma-build.conf.js')(config);
4+
5+
config.plugins.push(require('karma-mocha'));
6+
config.frameworks.push('mocha');
7+
config.client.mocha = {
8+
timeout: 5000 // copied timeout for Jasmine in WebSocket.spec (otherwise Mochas default timeout at 2 sec is to low for the tests)
9+
};
10+
};

karma-sauce-mocha.conf.js renamed to karma-build-sauce-mocha.conf.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
*/
88

99
module.exports = function (config) {
10-
require('./karma.conf')(config);
11-
require('./karma-mocha.conf')(config);
10+
require('./karma-dist-mocha.conf.js')(config);
1211
require('./sauce.conf')(config);
1312
};

karma-build.conf.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/**
2+
* @license
3+
* Copyright Google Inc. All Rights Reserved.
4+
*
5+
* Use of this source code is governed by an MIT-style license that can be
6+
* found in the LICENSE file at https://angular.io/license
7+
*/
8+
9+
module.exports = function (config) {
10+
require('./karma-base.conf.js')(config);
11+
config.files.push('build/test/wtf_mock.js');
12+
config.files.push('build/lib/zone.js');
13+
config.files.push('build/test/main.js');
14+
};

karma-jasmine.conf.js renamed to karma-dist-jasmine.conf.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
module.exports = function (config) {
3-
require('./karma.conf')(config);
3+
require('./karma-dist.conf.js')(config);
44

55
config.plugins.push(require('karma-jasmine'));
66
config.frameworks.push('jasmine');

karma-mocha.conf.js renamed to karma-dist-mocha.conf.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
module.exports = function (config) {
3-
require('./karma.conf')(config);
3+
require('./karma-dist.conf.js')(config);
44

55
config.plugins.push(require('karma-mocha'));
66
config.frameworks.push('mocha');

karma-sauce-jasmine.conf.js renamed to karma-dist-sauce-jasmine.conf.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
*/
88

99
module.exports = function (config) {
10-
require('./karma.conf')(config);
11-
require('./karma-jasmine.conf')(config);
10+
require('./karma-dist-jasmine.conf.js')(config);
1211
require('./sauce.conf')(config);
1312
};

karma-dist.conf.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/**
2+
* @license
3+
* Copyright Google Inc. All Rights Reserved.
4+
*
5+
* Use of this source code is governed by an MIT-style license that can be
6+
* found in the LICENSE file at https://angular.io/license
7+
*/
8+
9+
module.exports = function (config) {
10+
require('./karma-base.conf.js')(config);
11+
config.files.push('build/test/wtf_mock.js');
12+
config.files.push('dist/zone.js');
13+
config.files.push('dist/async-test.js');
14+
config.files.push('dist/fake-async-test.js');
15+
config.files.push('dist/long-stack-trace-zone.js');
16+
config.files.push('dist/proxy.js');
17+
config.files.push('dist/sync-test.js');
18+
config.files.push('dist/task-tracking.js');
19+
config.files.push('dist/wtf.js');
20+
config.files.push('build/test/main.js');
21+
};

0 commit comments

Comments
 (0)