test: scope internal test fixtures under @electron-ci
(#33822)
* test: scope internal test fixtures under `@electron` * Missed references * Move packages from @electron to @electron-ci scope * Fix tests
This commit is contained in:
parent
9901d2f281
commit
e1ed96b574
9 changed files with 20 additions and 17 deletions
|
@ -7,7 +7,7 @@
|
||||||
let requireError
|
let requireError
|
||||||
|
|
||||||
try {
|
try {
|
||||||
echo = require('echo')
|
echo = require('@electron-ci/echo')
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
requireError = error
|
requireError = error
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
let echo;
|
let echo;
|
||||||
try {
|
try {
|
||||||
echo = require('echo');
|
echo = require('@electron-ci/echo');
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,5 +2,5 @@ process.on('uncaughtException', function (err) {
|
||||||
process.send(err.message);
|
process.send(err.message);
|
||||||
});
|
});
|
||||||
|
|
||||||
const echo = require('echo');
|
const echo = require('@electron-ci/echo');
|
||||||
process.send(echo('ok'));
|
process.send(echo('ok'));
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
require('uv-dlopen');
|
require('@electron-ci/uv-dlopen');
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
|
|
||||||
{
|
{
|
||||||
"main": "./lib/echo.js",
|
"main": "./lib/echo.js",
|
||||||
"name": "echo",
|
"name": "@electron-ci/echo",
|
||||||
"version": "0.0.1"
|
"version": "0.0.1"
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
"name": "uv-dlopen",
|
"name": "@electron-ci/uv-dlopen",
|
||||||
"version": "0.0.1",
|
"version": "0.0.1",
|
||||||
"main": "index.js"
|
"main": "index.js"
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,7 +21,11 @@ describe('modules support', () => {
|
||||||
it('can be required in renderer', async () => {
|
it('can be required in renderer', async () => {
|
||||||
const w = new BrowserWindow({ show: false, webPreferences: { nodeIntegration: true, contextIsolation: false } });
|
const w = new BrowserWindow({ show: false, webPreferences: { nodeIntegration: true, contextIsolation: false } });
|
||||||
w.loadURL('about:blank');
|
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 () {
|
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 () => {
|
it('can be required in renderer', async () => {
|
||||||
const w = new BrowserWindow({ show: false, webPreferences: { nodeIntegration: true, contextIsolation: false } });
|
const w = new BrowserWindow({ show: false, webPreferences: { nodeIntegration: true, contextIsolation: false } });
|
||||||
w.loadURL('about:blank');
|
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 () {
|
ifit(features.isRunAsNodeEnabled())('can be required in node binary', async function () {
|
||||||
|
|
|
@ -4,13 +4,13 @@
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"version": "0.1.0",
|
"version": "0.1.0",
|
||||||
"devDependencies": {
|
"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/sinon": "^9.0.4",
|
||||||
"@types/ws": "^7.2.0",
|
"@types/ws": "^7.2.0",
|
||||||
"busboy": "^0.3.1",
|
"busboy": "^0.3.1",
|
||||||
"echo": "file:fixtures/native-addon/echo",
|
|
||||||
"q": "^1.5.1",
|
"q": "^1.5.1",
|
||||||
"sinon": "^9.0.1",
|
"sinon": "^9.0.1",
|
||||||
"uv-dlopen": "./fixtures/native-addon/uv-dlopen/",
|
|
||||||
"ws": "^7.4.6"
|
"ws": "^7.4.6"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|
|
@ -2,6 +2,12 @@
|
||||||
# yarn lockfile v1
|
# 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":
|
"@sinonjs/commons@^1", "@sinonjs/commons@^1.6.0", "@sinonjs/commons@^1.7.0", "@sinonjs/commons@^1.7.2":
|
||||||
version "1.8.0"
|
version "1.8.0"
|
||||||
resolved "https://registry.yarnpkg.com/@sinonjs/commons/-/commons-1.8.0.tgz#c8d68821a854c555bba172f3b06959a0039b236d"
|
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"
|
jsbn "~0.1.0"
|
||||||
safer-buffer "^2.1.0"
|
safer-buffer "^2.1.0"
|
||||||
|
|
||||||
"echo@file:fixtures/native-addon/echo":
|
|
||||||
version "0.0.1"
|
|
||||||
|
|
||||||
emojis-list@^2.0.0:
|
emojis-list@^2.0.0:
|
||||||
version "2.1.0"
|
version "2.1.0"
|
||||||
resolved "https://registry.yarnpkg.com/emojis-list/-/emojis-list-2.1.0.tgz#4daa4d9db00f9819880c79fa457ae5b09a1fd389"
|
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"
|
resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.4.0.tgz#b23e4358afa8a202fe7a100af1f5f883f02007ee"
|
||||||
integrity sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==
|
integrity sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==
|
||||||
|
|
||||||
uv-dlopen@./fixtures/native-addon/uv-dlopen/:
|
|
||||||
version "0.0.1"
|
|
||||||
|
|
||||||
verror@1.10.0:
|
verror@1.10.0:
|
||||||
version "1.10.0"
|
version "1.10.0"
|
||||||
resolved "https://registry.yarnpkg.com/verror/-/verror-1.10.0.tgz#3a105ca17053af55d6e270c1f8288682e18da400"
|
resolved "https://registry.yarnpkg.com/verror/-/verror-1.10.0.tgz#3a105ca17053af55d6e270c1f8288682e18da400"
|
||||||
|
|
Loading…
Reference in a new issue