Skip to content

Commit d6aa01d

Browse files
author
benholloway
committed
tweaked expectations for test task
1 parent ff46bc9 commit d6aa01d

File tree

4 files changed

+18
-6
lines changed

4 files changed

+18
-6
lines changed

test/expected/minimal-es5-unminified/app-test/karma.conf.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
module.exports = function(config) {
88
config.set({
99
// base path, that will be used to resolve files and exclude
10-
basePath: '/Users/benholloway/Documents/WebstormProjects/angularity/node-angularity/test/expected/minimal-es5-unminified',
10+
basePath: '/Users/benholloway/Documents/WebstormProjects/angularity/node-angularity/test/expected/minimal-es5',
1111

1212
//make sure we use karma-jasmine as the test framework
1313
frameworks: ['jasmine'],
@@ -41,12 +41,14 @@ module.exports = function(config) {
4141
// installation and thus need to be registered manually
4242
// append to existing value to preserve plugins loaded automatically
4343
plugins: [].concat(config.plugins).concat([
44-
44+
require("/Users/benholloway/Documents/WebstormProjects/angularity/node-angularity/node_modules/karma-angularity-reporter")
4545
]),
4646

4747
// use dots reporter, as travis terminal does not support escaping sequences
4848
// possible values: 'dots', 'progress', 'junit', 'teamcity'
49-
reporters: [].concat([]),
49+
reporters: [].concat([
50+
'angularity'
51+
]),
5052

5153
// web server port
5254
port: 61680,

test/expected/minimal-es5/app-test/karma.conf.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,14 @@ module.exports = function(config) {
4141
// installation and thus need to be registered manually
4242
// append to existing value to preserve plugins loaded automatically
4343
plugins: [].concat(config.plugins).concat([
44-
44+
require("/Users/benholloway/Documents/WebstormProjects/angularity/node-angularity/node_modules/karma-angularity-reporter")
4545
]),
4646

4747
// use dots reporter, as travis terminal does not support escaping sequences
4848
// possible values: 'dots', 'progress', 'junit', 'teamcity'
49-
reporters: [].concat([]),
49+
reporters: [].concat([
50+
'angularity'
51+
]),
5052

5153
// web server port
5254
port: 61680,

test/specs/tasks/build.spec.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,11 @@ function expectations(testCase) {
7474
var sourceTestFile = helper.getConcatenation(testCase.sourceDir, TEST_FOLDER);
7575

7676
// general
77+
if (/test/.test(testCase.command)) { // TODO @bholloway test should inherit JS not build
78+
expect(testCase.stdout).toBeTask('javascript');
79+
} else {
7780
expect(testCase.stdout).toBeTask(['build', 'javascript', 'css']);
81+
}
7882
expect(testCase.cwd).toHaveExpectedItemsExcept();
7983

8084
// build output
@@ -87,11 +91,14 @@ function expectations(testCase) {
8791
// must remove basePath to allow karma.conf.js to be correctly diff'd
8892
var replace = helper.replacer()
8993
.add(/^\s*basePath:.*$/gm, '')
94+
.add(/^\s*require\(.*$/gm, '')
9095
.add(/\\{2}/g, '/')
9196
.commit();
9297

9398
// test output
94-
expect(replace(workingTestFile('karma.conf.js'))).diffPatch(replace(sourceTestFile('karma.conf.js')));
99+
if (/test/.test(testCase.command)) {
100+
expect(replace(workingTestFile('karma.conf.js'))).diffPatch(replace(sourceTestFile('karma.conf.js'))); // TODO @bholloway reporter differs between build and test tasks
101+
}
95102
expect(workingTestFile('index.js')).diffFilePatch(sourceTestFile('index.js'));
96103
// expect(workingTestFile('index.js.map')).diffFilePatch(sourceTestFile('index.js.map')); // TODO @bholloway solve repeatability of .map files
97104
}

test/specs/tasks/test.spec.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,5 +63,6 @@ describe('The Angularity test task', function () {
6363

6464
function expectations(testCase) {
6565
expect(testCase.stdout).toBeTask('test');
66+
expect(testCase.stdout).toMatch(/^Karma tests\:\s+1\/1$/m);
6667
buildSpec.expectations(testCase);
6768
}

0 commit comments

Comments
 (0)