Skip to content

Commit 25024b6

Browse files
committed
Update the vitest config
1 parent 3ac633e commit 25024b6

File tree

3 files changed

+12
-8
lines changed

3 files changed

+12
-8
lines changed

.github/workflows/test.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,8 @@ jobs:
8484
- name: Install
8585
run: yarn install --frozen-lockfile
8686
- name: Build
87-
run: bun run --filter '*' build
87+
run: yarn build
8888
- name: Generate
8989
run: bun run --filter '*' generate
9090
- name: Unit Tests
9191
run: bun run --bun --filter '*' test:unit
92-

packages/as-sha256/package.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,7 @@
3434
"build:web": "webpack --mode production --entry ./index.js --output ./dist/as-sha256.min.js",
3535
"build": "yarn asbuild && yarn asbuild:simd && yarn generate && yarn build:lib",
3636
"test:unit": "vitest run --dir test/unit/",
37-
"test:browsers": "yarn test:browsers:chrome && yarn test:browsers:firefox",
38-
"test:browsers:chrome": "vitest run --browser chrome --config ./vitest.browser.config.ts --dir test/unit",
39-
"test:browsers:firefox": "vitest run --browser firefox --config ./vitest.browser.config.ts --dir test/unit",
37+
"test:browsers": "vitest run --config ./vitest.browser.config.ts --dir test/unit",
4038
"benchmark": "node -r ts-node/register ./node_modules/.bin/benchmark 'test/perf/*.test.ts'",
4139
"benchmark:local": "yarn benchmark --local",
4240
"test:ci": "yarn test:as-ci"

vitest.base.browser.config.ts

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { defineConfig, mergeConfig } from "vitest/config";
2-
import {nodePolyfills} from "vite-plugin-node-polyfills";
2+
import { nodePolyfills } from "vite-plugin-node-polyfills";
33

44
import baseConfig from "./vitest.base.unit.config";
55

@@ -9,17 +9,24 @@ export default mergeConfig(
99
plugins: [
1010
nodePolyfills({
1111
include: ["buffer", "crypto", "util", "stream"],
12-
globals: {Buffer: true},
12+
globals: { Buffer: true },
1313
protocolImports: true,
1414
}),
1515
],
1616
test: {
1717
browser: {
18-
name: "chrome",
1918
headless: true,
2019
provider: "webdriverio",
2120
screenshotFailures: false,
21+
instances: [{ browser: "chrome" }, { browser: "firefox" }],
2222
},
2323
},
24+
optimizeDeps: {
25+
include: [
26+
"vite-plugin-node-polyfills/shims/buffer",
27+
"vite-plugin-node-polyfills/shims/global",
28+
"vite-plugin-node-polyfills/shims/process",
29+
],
30+
},
2431
})
2532
);

0 commit comments

Comments
 (0)