@ohos-ports/floss 5.0.1-beta.0 → 5.0.1-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/node-runner.js +7 -0
- package/package.json +1 -1
package/lib/node-runner.js
CHANGED
|
@@ -19,6 +19,13 @@ const querystring = require("querystring");
|
|
|
19
19
|
function runInNode(opts) {
|
|
20
20
|
return new Promise((resolve, reject) => {
|
|
21
21
|
try {
|
|
22
|
+
// Set global options (same as renderer.js line 41)
|
|
23
|
+
// This allows test code to access custom options via global.options
|
|
24
|
+
global.options = opts;
|
|
25
|
+
// Inject args into process.argv (same as Electron spawn behavior)
|
|
26
|
+
if (opts.args && opts.args.length) {
|
|
27
|
+
process.argv.push(...opts.args);
|
|
28
|
+
}
|
|
22
29
|
// Set up jsdom environment for DOM-dependent tests
|
|
23
30
|
// jsdom provides a real DOM implementation (not a stub)
|
|
24
31
|
const { JSDOM } = require('jsdom');
|