Skip to content

Commit 2571c27

Browse files
committed
Run CI builds on Windows as well as Linux
1 parent d1f4e62 commit 2571c27

File tree

3 files changed

+20
-14
lines changed

3 files changed

+20
-14
lines changed

.travis.yml

+3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
sudo: false
22
language: node_js
3+
os:
4+
- linux
5+
- windows
36
# NOTE: When changing the list of Node versions, be sure to update `engines`
47
# in package.json as well as setup/nodejs.md in the docs repo.
58
node_js:

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"url": "https://github.com/jasmine/jasmine-npm"
1616
},
1717
"scripts": {
18-
"test": "./bin/jasmine.js",
18+
"test": "node ./bin/jasmine.js",
1919
"posttest": "eslint \"bin/**/*.js\" \"lib/**/*.js\" \"spec/**/*.js\""
2020
},
2121
"dependencies": {

spec/command_spec.js

+16-13
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,17 @@ function deleteDirectory(dir) {
2222
}
2323
}
2424

25+
function withValueForIsTTY(value, func) {
26+
var wasTTY = process.stdout.isTTY;
27+
try {
28+
process.stdout.isTTY = value;
29+
func();
30+
} finally {
31+
process.stdout.isTTY = wasTTY;
32+
}
33+
}
34+
35+
2536
describe('command', function() {
2637
beforeEach(function() {
2738
var examplesDir = path.resolve(path.join(__dirname, 'fixtures', 'example'));
@@ -132,9 +143,11 @@ describe('command', function() {
132143

133144
describe('--', function() {
134145
it('skips anything after it', function() {
135-
this.command.run(this.fakeJasmine, ['node', 'bin/jasmine.js', '--', '--no-color']);
136-
expect(this.out.getOutput()).toBe('');
137-
expect(this.fakeJasmine.showColors).toHaveBeenCalledWith(true);
146+
withValueForIsTTY(true, function () {
147+
this.command.run(this.fakeJasmine, ['node', 'bin/jasmine.js', '--', '--no-color']);
148+
expect(this.out.getOutput()).toBe('');
149+
expect(this.fakeJasmine.showColors).toHaveBeenCalledWith(true);
150+
}.bind(this));
138151
});
139152
});
140153

@@ -158,16 +171,6 @@ describe('command', function() {
158171
});
159172

160173
describe('running specs', function() {
161-
var withValueForIsTTY = function(value, func) {
162-
var wasTTY = process.stdout.isTTY;
163-
try {
164-
process.stdout.isTTY = value;
165-
func();
166-
} finally {
167-
process.stdout.isTTY = wasTTY;
168-
}
169-
};
170-
171174
beforeEach(function() {
172175
this.originalConfigPath = process.env.JASMINE_CONFIG_PATH;
173176
});

0 commit comments

Comments
 (0)