diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2e0ae055..246db446 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -84,9 +84,8 @@ jobs: - name: Install run: yarn install --frozen-lockfile - name: Build - run: bun run --filter '*' build + run: yarn build - name: Generate run: bun run --filter '*' generate - name: Unit Tests run: bun run --bun --filter '*' test:unit - diff --git a/packages/as-sha256/package.json b/packages/as-sha256/package.json index 76a304ff..5e5fdc8b 100644 --- a/packages/as-sha256/package.json +++ b/packages/as-sha256/package.json @@ -34,9 +34,7 @@ "build:web": "webpack --mode production --entry ./index.js --output ./dist/as-sha256.min.js", "build": "yarn asbuild && yarn asbuild:simd && yarn generate && yarn build:lib", "test:unit": "vitest run --dir test/unit/", - "test:browsers": "yarn test:browsers:chrome && yarn test:browsers:firefox", - "test:browsers:chrome": "vitest run --browser chrome --config ./vitest.browser.config.ts --dir test/unit", - "test:browsers:firefox": "vitest run --browser firefox --config ./vitest.browser.config.ts --dir test/unit", + "test:browsers": "vitest run --config ./vitest.browser.config.ts --dir test/unit", "benchmark": "node -r ts-node/register ./node_modules/.bin/benchmark 'test/perf/*.test.ts'", "benchmark:local": "yarn benchmark --local", "test:ci": "yarn test:as-ci" diff --git a/vitest.base.browser.config.ts b/vitest.base.browser.config.ts index 2735ddae..1ef5d630 100644 --- a/vitest.base.browser.config.ts +++ b/vitest.base.browser.config.ts @@ -1,5 +1,5 @@ import { defineConfig, mergeConfig } from "vitest/config"; -import {nodePolyfills} from "vite-plugin-node-polyfills"; +import { nodePolyfills } from "vite-plugin-node-polyfills"; import baseConfig from "./vitest.base.unit.config"; @@ -9,17 +9,24 @@ export default mergeConfig( plugins: [ nodePolyfills({ include: ["buffer", "crypto", "util", "stream"], - globals: {Buffer: true}, + globals: { Buffer: true }, protocolImports: true, }), ], test: { browser: { - name: "chrome", headless: true, provider: "webdriverio", screenshotFailures: false, + instances: [{ browser: "chrome" }, { browser: "firefox" }], }, }, + optimizeDeps: { + include: [ + "vite-plugin-node-polyfills/shims/buffer", + "vite-plugin-node-polyfills/shims/global", + "vite-plugin-node-polyfills/shims/process", + ], + }, }) );