Skip to content

Commit

Permalink
Make some test paths Windows-compatible
Browse files Browse the repository at this point in the history
  • Loading branch information
jason0x43 committed Nov 27, 2021
1 parent 0707d63 commit fb9c555
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions tests/unit/SauceLabsTunnel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,26 +21,27 @@ registerSuite('unit/SauceLabsTunnel', () => {

tunnel.platform = 'osx';
tunnel.architecture = 'foo';
let executable = /\/sc-\d+\.\d+(?:\.\d+)?-osx\/bin\/sc$/;
let executable = /(\/|\\)sc-\d+\.\d+(?:\.\d+)?-osx(\/|\\)bin(\/|\\)sc$/;
assert.match(tunnel.executable, executable);

tunnel.platform = 'linux';
assert.equal(tunnel.executable, 'java');

tunnel.architecture = 'x64';
executable = /\/sc-\d+\.\d+(?:\.\d+)?-linux\/bin\/sc$/;
executable = /(\/|\\)sc-\d+\.\d+(?:\.\d+)?-linux\/bin\/sc$/;
assert.match(tunnel.executable, executable);

tunnel.platform = 'win32';
executable = /\/sc-\d+\.\d+(?:\.\d+)?-win32\/bin\/sc\.exe$/;
executable =
/(\/|\\)sc-\d+\.\d+(?:\.\d+)?-win32(\/|\\)bin(\/|\\)sc\.exe$/;
assert.match(tunnel.executable, executable);
},

'#extraCapabilities'() {
assert.deepEqual(tunnel.extraCapabilities, {});
tunnel.tunnelId = 'foo';
assert.deepEqual(tunnel.extraCapabilities, {
'tunnel-identifier': 'foo'
'tunnel-identifier': 'foo',
});
},

Expand All @@ -58,14 +59,16 @@ registerSuite('unit/SauceLabsTunnel', () => {
);

tunnel.platform = 'darwin';
let url = /https:\/\/saucelabs\.com\/downloads\/sc-\d+\.\d+(?:\.\d+)?-osx\.zip/;
let url =
/https:\/\/saucelabs\.com\/downloads\/sc-\d+\.\d+(?:\.\d+)?-osx\.zip/;
assert.match(tunnel.url, url);

tunnel.platform = 'linux';
tunnel.architecture = 'x64';
url = /https:\/\/saucelabs\.com\/downloads\/sc-\d+\.\d+(?:\.\d+)?-linux\.tar\.gz/;
url =
/https:\/\/saucelabs\.com\/downloads\/sc-\d+\.\d+(?:\.\d+)?-linux\.tar\.gz/;
assert.match(tunnel.url, url);
}
}
},
},
};
});

0 comments on commit fb9c555

Please sign in to comment.