Skip to content
This repository was archived by the owner on Dec 20, 2023. It is now read-only.

Commit d850ac3

Browse files
committed
Don't run linux tests when not on linux
1 parent 33388f1 commit d850ac3

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

test/index.test.js

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,13 @@ var NODE = which.sync('node');
1818
debug('path to m bin is %s', M);
1919
debug('path to node bin is %s', NODE);
2020

21+
var skipIfNotLinux = function(runner) {
22+
if (process.platform !== 'linux') {
23+
runner.skip();
24+
return;
25+
}
26+
};
27+
2128
var run = function(command, done) {
2229
/* eslint no-sync:0 no-console:0 */
2330
if (typeof command === 'function') {
@@ -266,26 +273,28 @@ describe('mongodb-version-manager', function() {
266273
});
267274
describe('linux', function() {
268275
it('should install 2.6.11 #slow', function(done) {
276+
skipIfNotLinux(this);
269277
this.slow(25000);
270278
use('2.6.11', 'linux', done);
271279
});
272280
it('should have current symlink in $PATH', function() {
281+
skipIfNotLinux(this);
273282
inPATH('current', 'linux');
274283
});
275284
it('should symlink 2.6.11 as current', function(done) {
276-
if (process.platform !== 'linux') {
277-
this.skip();
278-
return;
279-
}
285+
skipIfNotLinux(this);
280286
shouldHaveCurrent('2.6.11', 'linux', done);
281287
});
282288
it('should have an executable shell binary', function(done) {
289+
skipIfNotLinux(this);
283290
shouldHaveExecutable('mongo', '2.6.11', 'linux', done);
284291
});
285292
it('should have an executable store binary', function(done) {
293+
skipIfNotLinux(this);
286294
shouldHaveExecutable('mongod', '2.6.11', 'linux', done);
287295
});
288296
it('should have an executable router binary', function(done) {
297+
skipIfNotLinux(this);
289298
shouldHaveExecutable('mongos', '2.6.11', 'linux', done);
290299
});
291300
});

0 commit comments

Comments
 (0)