From 64f3c1c1998293fe4a0fcd786a68aadaafa3fe3c Mon Sep 17 00:00:00 2001 From: Samuel Attard Date: Sun, 12 Apr 2026 03:03:39 -0700 Subject: [PATCH] chore: route itremote/remotely closure imports through remote-tools Swaps expect/setTimeout/BrowserWindow imports in the 5 files flagged by remote-tools-imports/no-foreign-imports-in-remote-closure so their stringified closures resolve via the __rt shim. Import-line changes only. --- spec/api-native-image.spec.ts | 2 +- spec/chromium.spec.ts | 2 +- spec/fuses.spec.ts | 3 +-- spec/node.spec.ts | 2 +- spec/webview.spec.ts | 3 +-- 5 files changed, 5 insertions(+), 7 deletions(-) diff --git a/spec/api-native-image.spec.ts b/spec/api-native-image.spec.ts index 08ab7bf1e6..9ab2cb04de 100644 --- a/spec/api-native-image.spec.ts +++ b/spec/api-native-image.spec.ts @@ -1,10 +1,10 @@ import { nativeImage } from 'electron/common'; -import { expect } from 'chai'; import { describe, it } from 'vitest'; import * as path from 'node:path'; +import { expect } from './lib/remote-tools'; import { ifdescribe, ifit, itremote, useRemoteContext } from './lib/spec-helpers'; import { expectDeprecationMessages } from './lib/warning-helpers'; diff --git a/spec/chromium.spec.ts b/spec/chromium.spec.ts index 7f518f1a5d..012901b565 100644 --- a/spec/chromium.spec.ts +++ b/spec/chromium.spec.ts @@ -12,7 +12,6 @@ import { MessageBoxOptions } from 'electron/main'; -import { expect } from 'chai'; import { afterAll, afterEach, beforeAll, beforeEach, describe, it } from 'vitest'; import * as ws from 'ws'; @@ -26,6 +25,7 @@ import * as path from 'node:path'; import { setTimeout } from 'node:timers/promises'; import * as url from 'node:url'; +import { expect } from './lib/remote-tools'; import { ifit, ifdescribe, diff --git a/spec/fuses.spec.ts b/spec/fuses.spec.ts index 8cc3bb4711..5555e3837c 100644 --- a/spec/fuses.spec.ts +++ b/spec/fuses.spec.ts @@ -1,5 +1,3 @@ -import { BrowserWindow } from 'electron'; - import { expect } from 'chai'; import { describe, it } from 'vitest'; @@ -7,6 +5,7 @@ import { spawn, spawnSync } from 'node:child_process'; import { once } from 'node:events'; import path = require('node:path'); +import { BrowserWindow } from './lib/remote-tools'; import { startRemoteControlApp } from './lib/spec-helpers'; describe('fuses', () => { diff --git a/spec/node.spec.ts b/spec/node.spec.ts index 07e9dd5a6f..2b47edff11 100644 --- a/spec/node.spec.ts +++ b/spec/node.spec.ts @@ -1,6 +1,5 @@ import { webContents } from 'electron/main'; -import { expect } from 'chai'; import { afterAll, afterEach, beforeEach, describe, it } from 'vitest'; import * as childProcess from 'node:child_process'; @@ -18,6 +17,7 @@ import { spawn } from './lib/codesign-helpers'; import { withTempDirectory } from './lib/fs-helpers'; +import { expect } from './lib/remote-tools'; import { getRemoteContext, ifdescribe, ifit, itremote, useRemoteContext, withDone } from './lib/spec-helpers'; const mainFixturesPath = path.resolve(__dirname, 'fixtures'); diff --git a/spec/webview.spec.ts b/spec/webview.spec.ts index 3533e4cd3f..bdded0b429 100644 --- a/spec/webview.spec.ts +++ b/spec/webview.spec.ts @@ -1,16 +1,15 @@ import { BrowserWindow, session, ipcMain, app, WebContents } from 'electron/main'; import * as auth from 'basic-auth'; -import { expect } from 'chai'; import { afterAll, afterEach, beforeAll, beforeEach, describe, it } from 'vitest'; import { once } from 'node:events'; import * as http from 'node:http'; import * as path from 'node:path'; -import { setTimeout } from 'node:timers/promises'; import * as url from 'node:url'; import { emittedUntil } from './lib/events-helpers'; +import { expect, setTimeout } from './lib/remote-tools'; import { HexColors, ScreenCapture, hasCapturableScreen } from './lib/screen-helpers'; import { ifit, ifdescribe, defer, itremote, useRemoteContext, listen } from './lib/spec-helpers'; import { closeAllWindows } from './lib/window-helpers';