siesta-lite
Version:
Stress-free JavaScript unit testing and functional testing tool, works in NodeJS and browsers
39 lines (38 loc) • 1.75 kB
JavaScript
// Exit codes:
// 0 - all tests passed
// 1 - there were test failures
// 2 - inactivity timeout while running the test suite
// 3 - no supported browsers available on this machine
// 4 - no tests to run (probably `include` doesn't match any test url or `exclude` match anything)
// 5 - can't open project page
// 6 - wrong arguments
// 7 - exception thrown
// 8 - exit after printing version
// 9 - java is not installed or not available in PATH
var path = require('path');
var argv = process.argv.slice(2);
var Module = require('module');
// this weirdly looking line activates the `patched` flag in `Module` module
// and forces the loader to use `vm.runInThisContext` - required after Node 10.5
Module.wrap = Module.wrap;
if (argv[0] == 'AS_CONNECTOR') {
var LogLevel_1 = require("./src/generic/util/role/CanLog.js").LogLevel;
var NodeJsPageChildEndPoint = require("./src/nodejs/launcher/NodeJsPageRpcClient.js").NodeJsPageChildEndPoint;
var CLIENT = new NodeJsPageChildEndPoint({ logLevel: LogLevel_1.debug });
CLIENT.connect();
var _project_ = CLIENT.projectContext;
_project_.SCOPE = global;
_project_.PROJECT_REQUIRE = require("esm")(module);
module.exports = _project_.Siesta;
}
else {
var requireInContext = require("./src/nodejs/util/helper/RequireInContext.js").requireInContext;
//----
// pass own `require` function to use file names, relative to this index file itself
// otherwise, file names should be relative to `CanRequireInContext` file
var _project_ = requireInContext('./siesta-nodejs-all.js', null, require);
_project_.AS_LAUNCHER = true;
_project_.SCOPE = global;
_project_.PROJECT_REQUIRE = require("esm")(module);
module.exports = _project_.Siesta;
}