Index: test/all.js |
=================================================================== |
--- a/test/all.js |
+++ b/test/all.js |
@@ -21,6 +21,24 @@ |
const path = require("path"); |
const {exec} = require("child_process"); |
+function getBrowserBinary(module, browser) |
+{ |
+ let spec = process.env[`${browser.toUpperCase()}_BINARY`]; |
+ let version = module.oldestCompatibleVersion; |
+ |
+ if (spec) |
+ { |
+ if (spec == "installed") |
+ return Promise.resolve(""); |
+ if (spec.startswith("path:")) |
+ return Promise.resolve(spec.substr(5)); |
+ if (spec.startsWith("download:")) |
+ version = spec.substr(9); |
tlucas
2018/09/26 08:20:16
Are we ok with not checking whether someone tries
Sebastian Noack
2018/09/26 11:00:20
I am. Since this needs to be explicitly requested,
|
+ } |
+ |
+ return module.ensureBrowser(version); |
+} |
+ |
for (let browser of glob.sync("./test/browsers/*.js")) |
{ |
let module = require(path.resolve(browser)); |
@@ -32,7 +50,7 @@ |
before(function() |
{ |
return Promise.all([ |
- module.ensureBrowser(), |
+ getBrowserBinary(module, path.basename(browser, ".js")), |
new Promise((resolve, reject) => |
{ |
exec( |