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:
Jeremy Rose 2022-08-09 00:39:14 -07:00 committed by GitHub
parent f3dbdaaf33
commit faa2f7afa3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 1439 additions and 1721 deletions

File diff suppressed because it is too large Load diff

View file

@ -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};

File diff suppressed because it is too large Load diff