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:
Jamie Magee 2022-05-02 10:09:23 -07:00 committed by GitHub
parent 9901d2f281
commit e1ed96b574
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 20 additions and 17 deletions

View file

@ -7,7 +7,7 @@
let requireError
try {
echo = require('echo')
echo = require('@electron-ci/echo')
} catch (error) {
requireError = error
}

View file

@ -1,6 +1,6 @@
let echo;
try {
echo = require('echo');
echo = require('@electron-ci/echo');
} catch (e) {
process.exit(1);
}

View file

@ -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'));

View file

@ -1 +1 @@
require('uv-dlopen');
require('@electron-ci/uv-dlopen');

View file

@ -1,6 +1,5 @@
{
"main": "./lib/echo.js",
"name": "echo",
"name": "@electron-ci/echo",
"version": "0.0.1"
}

View file

@ -1,5 +1,5 @@
{
"name": "uv-dlopen",
"name": "@electron-ci/uv-dlopen",
"version": "0.0.1",
"main": "index.js"
}

View file

@ -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 () {

View file

@ -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": {

View file

@ -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"