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:
parent
f3dbdaaf33
commit
faa2f7afa3
3 changed files with 1439 additions and 1721 deletions
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
Loading…
Reference in a new issue