mirror of
https://github.com/electron/electron.git
synced 2026-01-09 15:38:08 -05:00
test: migrate asar specs to main runner (#35230)
* test: migrate node specs to main * test: migrate asar specs to main runner * fix execFile
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -149,9 +149,10 @@ export async function repeatedly<T> (
|
||||
}
|
||||
|
||||
async function makeRemoteContext (opts?: any) {
|
||||
const { webPreferences, ...rest } = opts ?? {};
|
||||
const { webPreferences, setup, url = 'about:blank', ...rest } = opts ?? {};
|
||||
const w = new BrowserWindow({ show: false, webPreferences: { nodeIntegration: true, contextIsolation: false, ...webPreferences }, ...rest });
|
||||
await w.loadURL('about:blank');
|
||||
await w.loadURL(url.toString());
|
||||
if (setup) await w.webContents.executeJavaScript(setup);
|
||||
return w;
|
||||
}
|
||||
|
||||
@@ -179,6 +180,7 @@ export async function itremote (name: string, fn: Function, args?: any[]) {
|
||||
const { ok, message } = await w.webContents.executeJavaScript(`(async () => {
|
||||
try {
|
||||
const chai_1 = require('chai')
|
||||
chai_1.use(require('chai-as-promised'))
|
||||
chai_1.use(require('dirty-chai'))
|
||||
await (${fn})(...${JSON.stringify(args ?? [])})
|
||||
return {ok: true};
|
||||
|
||||
1719
spec/asar-spec.js
1719
spec/asar-spec.js
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user