Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
Menci committed Dec 19, 2024
1 parent 4120a3d commit 8b040cd
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node: ["14", "16", "18", "20", "22"]
node: ["20"]
name: Test on Node.js ${{ matrix.node }}
steps:
- uses: actions/checkout@v4
Expand All @@ -25,6 +25,8 @@ jobs:
run: yarn --frozen-lockfile
- name: Build
run: yarn build
- name: Setup tmate session
uses: mxschmitt/action-tmate@v3
- name: Test
run: yarn test
- name: Check style
Expand Down
16 changes: 9 additions & 7 deletions e2e/e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import fs from "fs";
import type { AddressInfo } from "net";

import { jest } from "@jest/globals";
import { firefox } from "playwright";
import { firefox, chromium } from "playwright";

import type { RollupOutput } from "rollup";
import vitePluginWasm from "../src/index.js";
Expand Down Expand Up @@ -129,12 +129,14 @@ async function startDevServer(tempDir: string, vitePackages: VitePackages): Prom
}

async function createBrowser(modernBrowser: boolean) {
return await firefox.launch({
firefoxUserPrefs: {
// Simulate a legacy browser with ES modules support disabled
"dom.moduleScripts.enabled": modernBrowser
}
});
return modernBrowser
? await chromium.launch()
: await firefox.launch({
firefoxUserPrefs: {
// Simulate a legacy browser with ES modules support disabled
"dom.moduleScripts.enabled": false
}
});
}

async function runTest(
Expand Down

0 comments on commit 8b040cd

Please sign in to comment.