diff --git a/spec-main/fixtures/api/native-window-open-native-addon.html b/spec-main/fixtures/api/native-window-open-native-addon.html index 27c24a60b755..c1cd5cea755a 100644 --- a/spec-main/fixtures/api/native-window-open-native-addon.html +++ b/spec-main/fixtures/api/native-window-open-native-addon.html @@ -7,7 +7,7 @@ let requireError try { - echo = require('echo') + echo = require('@electron-ci/echo') } catch (error) { requireError = error } diff --git a/spec-main/fixtures/module/echo-renamed.js b/spec-main/fixtures/module/echo-renamed.js index 7b4b195f88f9..6dfa05f914a3 100644 --- a/spec-main/fixtures/module/echo-renamed.js +++ b/spec-main/fixtures/module/echo-renamed.js @@ -1,6 +1,6 @@ let echo; try { - echo = require('echo'); + echo = require('@electron-ci/echo'); } catch (e) { process.exit(1); } diff --git a/spec-main/fixtures/module/echo.js b/spec-main/fixtures/module/echo.js index 915d0e339389..ae1b31dd9bed 100644 --- a/spec-main/fixtures/module/echo.js +++ b/spec-main/fixtures/module/echo.js @@ -2,5 +2,5 @@ process.on('uncaughtException', function (err) { process.send(err.message); }); -const echo = require('echo'); +const echo = require('@electron-ci/echo'); process.send(echo('ok')); diff --git a/spec-main/fixtures/module/uv-dlopen.js b/spec-main/fixtures/module/uv-dlopen.js index c2f0cb94b787..2f1e3413f325 100644 --- a/spec-main/fixtures/module/uv-dlopen.js +++ b/spec-main/fixtures/module/uv-dlopen.js @@ -1 +1 @@ -require('uv-dlopen'); +require('@electron-ci/uv-dlopen'); diff --git a/spec-main/fixtures/native-addon/echo/package.json b/spec-main/fixtures/native-addon/echo/package.json index 650586e32612..74956d42a0e2 100644 --- a/spec-main/fixtures/native-addon/echo/package.json +++ b/spec-main/fixtures/native-addon/echo/package.json @@ -1,6 +1,5 @@ - { "main": "./lib/echo.js", - "name": "echo", + "name": "@electron-ci/echo", "version": "0.0.1" } diff --git a/spec-main/fixtures/native-addon/uv-dlopen/package.json b/spec-main/fixtures/native-addon/uv-dlopen/package.json index 32d7aeb11c7c..f6844acfeb0f 100644 --- a/spec-main/fixtures/native-addon/uv-dlopen/package.json +++ b/spec-main/fixtures/native-addon/uv-dlopen/package.json @@ -1,5 +1,5 @@ { - "name": "uv-dlopen", + "name": "@electron-ci/uv-dlopen", "version": "0.0.1", "main": "index.js" } diff --git a/spec-main/modules-spec.ts b/spec-main/modules-spec.ts index 8554bc525dab..a83797961fcf 100644 --- a/spec-main/modules-spec.ts +++ b/spec-main/modules-spec.ts @@ -21,7 +21,11 @@ describe('modules support', () => { it('can be required in renderer', async () => { const w = new BrowserWindow({ show: false, webPreferences: { nodeIntegration: true, contextIsolation: false } }); w.loadURL('about:blank'); - await expect(w.webContents.executeJavaScript('{ require(\'echo\'); null }')).to.be.fulfilled(); + await expect( + w.webContents.executeJavaScript( + "{ require('@electron-ci/echo'); null }" + ) + ).to.be.fulfilled(); }); ifit(features.isRunAsNodeEnabled())('can be required in node binary', async function () { @@ -53,7 +57,7 @@ describe('modules support', () => { it('can be required in renderer', async () => { const w = new BrowserWindow({ show: false, webPreferences: { nodeIntegration: true, contextIsolation: false } }); w.loadURL('about:blank'); - await expect(w.webContents.executeJavaScript('{ require(\'uv-dlopen\'); null }')).to.be.fulfilled(); + await expect(w.webContents.executeJavaScript('{ require(\'@electron-ci/uv-dlopen\'); null }')).to.be.fulfilled(); }); ifit(features.isRunAsNodeEnabled())('can be required in node binary', async function () { diff --git a/spec-main/package.json b/spec-main/package.json index dfbfd1330da3..1635e32313cd 100644 --- a/spec-main/package.json +++ b/spec-main/package.json @@ -4,13 +4,13 @@ "main": "index.js", "version": "0.1.0", "devDependencies": { + "@electron-ci/echo": "file:./fixtures/native-addon/echo", + "@electron-ci/uv-dlopen": "file:./fixtures/native-addon/uv-dlopen/", "@types/sinon": "^9.0.4", "@types/ws": "^7.2.0", "busboy": "^0.3.1", - "echo": "file:fixtures/native-addon/echo", "q": "^1.5.1", "sinon": "^9.0.1", - "uv-dlopen": "./fixtures/native-addon/uv-dlopen/", "ws": "^7.4.6" }, "dependencies": { diff --git a/spec-main/yarn.lock b/spec-main/yarn.lock index 6f6264a60426..28e15239334c 100644 --- a/spec-main/yarn.lock +++ b/spec-main/yarn.lock @@ -2,6 +2,12 @@ # yarn lockfile v1 +"@electron-ci/echo@file:./fixtures/native-addon/echo": + version "0.0.1" + +"@electron-ci/uv-dlopen@file:./fixtures/native-addon/uv-dlopen": + version "0.0.1" + "@sinonjs/commons@^1", "@sinonjs/commons@^1.6.0", "@sinonjs/commons@^1.7.0", "@sinonjs/commons@^1.7.2": version "1.8.0" resolved "https://registry.yarnpkg.com/@sinonjs/commons/-/commons-1.8.0.tgz#c8d68821a854c555bba172f3b06959a0039b236d" @@ -320,9 +326,6 @@ ecc-jsbn@~0.1.1: jsbn "~0.1.0" safer-buffer "^2.1.0" -"echo@file:fixtures/native-addon/echo": - version "0.0.1" - emojis-list@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/emojis-list/-/emojis-list-2.1.0.tgz#4daa4d9db00f9819880c79fa457ae5b09a1fd389" @@ -949,9 +952,6 @@ uuid@^3.3.2: resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.4.0.tgz#b23e4358afa8a202fe7a100af1f5f883f02007ee" integrity sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A== -uv-dlopen@./fixtures/native-addon/uv-dlopen/: - version "0.0.1" - verror@1.10.0: version "1.10.0" resolved "https://registry.yarnpkg.com/verror/-/verror-1.10.0.tgz#3a105ca17053af55d6e270c1f8288682e18da400"