General source code refactoring
This commit is contained in:
11
tests/support/application.cjs
Normal file
11
tests/support/application.cjs
Normal file
@@ -0,0 +1,11 @@
|
||||
const vm = require("node:vm");
|
||||
const { composeScript } = require("../../scripts/compose.cjs");
|
||||
|
||||
function loadApplication(target, globals = {}) {
|
||||
const factory = new vm.Script(composeScript(target, { bootstrap: false }), {
|
||||
filename: `${target}.test-bundle.js`
|
||||
}).runInNewContext(globals);
|
||||
return factory();
|
||||
}
|
||||
|
||||
module.exports = { loadApplication, composeScript };
|
||||
Reference in New Issue
Block a user