Skip to content

Commit

Permalink
Run CI builds on Windows as well as Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
sgravrock committed Oct 29, 2020
1 parent d1f4e62 commit 2571c27
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 14 deletions.
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
sudo: false
language: node_js
os:
- linux
- windows
# NOTE: When changing the list of Node versions, be sure to update `engines`
# in package.json as well as setup/nodejs.md in the docs repo.
node_js:
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"url": "https://github.com/jasmine/jasmine-npm"
},
"scripts": {
"test": "./bin/jasmine.js",
"test": "node ./bin/jasmine.js",
"posttest": "eslint \"bin/**/*.js\" \"lib/**/*.js\" \"spec/**/*.js\""
},
"dependencies": {
Expand Down
29 changes: 16 additions & 13 deletions spec/command_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,17 @@ function deleteDirectory(dir) {
}
}

function withValueForIsTTY(value, func) {
var wasTTY = process.stdout.isTTY;
try {
process.stdout.isTTY = value;
func();
} finally {
process.stdout.isTTY = wasTTY;
}
}


describe('command', function() {
beforeEach(function() {
var examplesDir = path.resolve(path.join(__dirname, 'fixtures', 'example'));
Expand Down Expand Up @@ -132,9 +143,11 @@ describe('command', function() {

describe('--', function() {
it('skips anything after it', function() {
this.command.run(this.fakeJasmine, ['node', 'bin/jasmine.js', '--', '--no-color']);
expect(this.out.getOutput()).toBe('');
expect(this.fakeJasmine.showColors).toHaveBeenCalledWith(true);
withValueForIsTTY(true, function () {
this.command.run(this.fakeJasmine, ['node', 'bin/jasmine.js', '--', '--no-color']);
expect(this.out.getOutput()).toBe('');
expect(this.fakeJasmine.showColors).toHaveBeenCalledWith(true);
}.bind(this));
});
});

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

describe('running specs', function() {
var withValueForIsTTY = function(value, func) {
var wasTTY = process.stdout.isTTY;
try {
process.stdout.isTTY = value;
func();
} finally {
process.stdout.isTTY = wasTTY;
}
};

beforeEach(function() {
this.originalConfigPath = process.env.JASMINE_CONFIG_PATH;
});
Expand Down

0 comments on commit 2571c27

Please sign in to comment.