Skip to content

Commit bed83c0

Browse files
committed
Merge pull request #405 from eleven-labs/fix-karma-traceur
Use Chrome browser instead of PhantomJS for Traceur
2 parents 463ce6d + da8bb9b commit bed83c0

File tree

5 files changed

+32
-8
lines changed

5 files changed

+32
-8
lines changed

app/files.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
"bower.json",
2626
"tsd.json",
2727

28+
"karma.conf.js",
29+
2830
"e2e/main.po.js",
2931

3032
"gulpfile.js",

app/templates/karma.conf.js renamed to app/templates/_karma.conf.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,20 @@ module.exports = function(config) {
77

88
frameworks: ['jasmine'],
99

10+
<% if(props.jsPreprocessor.key === 'traceur') { %>
11+
browsers : ['Chrome'],
12+
13+
plugins : [
14+
'karma-chrome-launcher',
15+
'karma-jasmine'
16+
]
17+
<% } else {%>
1018
browsers : ['PhantomJS'],
1119

1220
plugins : [
1321
'karma-phantomjs-launcher',
1422
'karma-jasmine'
1523
]
24+
<% } %>
1625
});
1726
};

app/templates/_package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,11 @@
7474
"jshint-stylish": "~1.0.0",
7575
"wiredep": "~2.2.0",
7676
"karma-jasmine": "~0.3.1",
77+
<% if(props.jsPreprocessor.key === 'traceur') { %>
78+
"karma-chrome-launcher": "~0.1.7",
79+
<% } else {%>
7780
"karma-phantomjs-launcher": "~0.1.4",
81+
<% } %>
7882
"require-dir": "~0.1.0",
7983
"browser-sync": "~2.1.4",
8084
"browser-sync-spa": "~1.0.1",

app/templates/gulp/_unit-tests.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,6 @@ module.exports = function(options) {
4141
}));
4242
}
4343

44-
<% if (props.jsPreprocessor.key === 'traceur') { %>
45-
gulp.task('test', ['browserify'], runTests.bind(this, true));
46-
gulp.task('test:auto', ['browserify'], runTests.bind(this, false));
47-
<% } else { %>
4844
gulp.task('test', ['scripts'], runTests.bind(this, true));
4945
gulp.task('test:auto', ['scripts'], runTests.bind(this, false));
50-
<% } %>
51-
5246
};

test/template/test-unit-tests.js

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,25 @@ describe('gulp-angular unit tests template', function () {
5757
result.should.match(/task\('test', \['scripts'\], runTests\./);
5858
result.should.match(/task\('test:auto', \['scripts'\], runTests\./);
5959

60+
model.props.jsPreprocessor.key = 'babel';
61+
result = unitTests(model);
62+
result.should.match(/task\('test', \['scripts'\], runTests\./);
63+
result.should.match(/task\('test:auto', \['scripts'\], runTests\./);
64+
6065
model.props.jsPreprocessor.key = 'traceur';
6166
result = unitTests(model);
62-
result.should.match(/task\('test', \['browserify'\], runTests\./);
63-
result.should.match(/task\('test:auto', \['browserify'\], runTests\./);
67+
result.should.match(/task\('test', \['scripts'\], runTests\./);
68+
result.should.match(/task\('test:auto', \['scripts'\], runTests\./);
69+
70+
model.props.jsPreprocessor.key = 'coffee';
71+
result = unitTests(model);
72+
result.should.match(/task\('test', \['scripts'\], runTests\./);
73+
result.should.match(/task\('test:auto', \['scripts'\], runTests\./);
74+
75+
model.props.jsPreprocessor.key = 'typescript';
76+
result = unitTests(model);
77+
result.should.match(/task\('test', \['scripts'\], runTests\./);
78+
result.should.match(/task\('test:auto', \['scripts'\], runTests\./);
6479
});
6580

6681
});

0 commit comments

Comments
 (0)