Skip to content

Commit

Permalink
chore(e2e): Skip vite-isolation-context-sandbox on node14
Browse files Browse the repository at this point in the history
  • Loading branch information
megahertz committed Dec 30, 2023
1 parent 9dcfda7 commit f1844e0
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 5 deletions.
10 changes: 10 additions & 0 deletions e2e/E2eApp.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,18 @@ class E2eApp {
return Number.parseInt(electronPackageJson.version, 10);
}

get nodeVersion() {
return Number.parseInt(process.version.replace('v', ''), 10);
}

isSupportEsm() {
return this.electronVersion >= 28;
}

log(...args) {
console.info('E2E:', ...args); // eslint-disable-line no-console
}

async run({ clearLogs = true } = {}) {
if (clearLogs) {
await this.removeLogDir();
Expand Down Expand Up @@ -91,6 +99,8 @@ class E2eApp {
.replace(/^Fontconfig.*$/mg, '')
.replace(/^.*Desktop Identity.*$/mg, '')
.replace(/^.*Gtk-WARNING.*$/mg, '')
.replace(/^.*bus.cc.*$/mg, '')
.replace(/^.*viz_main_impl.cc.*$/mg, '')
.replace(/^\n/mg, '');

// eslint-disable-next-line no-console
Expand Down
6 changes: 1 addition & 5 deletions e2e/esbuild-esm/main.spec.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const app = new E2eApp({ appPath: __dirname });

test(app.appName, async () => {
if (!app.isSupportEsm()) {
console.info(`Skipping ESM test for Electron ${app.electronVersion}`);
app.log(`Skipping ESM test for Electron ${app.electronVersion}`);
return;
}

Expand All @@ -17,7 +17,3 @@ test(app.appName, async () => {
'log from renderer',
]);
}, app.timeout);

function electronSupportsEsm() {

}
5 changes: 5 additions & 0 deletions e2e/vite-isolation-context-sandbox/main.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ const E2eApp = require('../E2eApp');
const app = new E2eApp({ appPath: __dirname });

test(app.appName, async () => {
if (app.nodeVersion < 16) {
app.log('Skipping because Vite requires Node 16 for this test');
return;
}

const logReader = await app.run();
expect(logReader.format()).toEqual([
'log from the main process',
Expand Down

0 comments on commit f1844e0

Please sign in to comment.