Skip to content

Commit 5ce9efe

Browse files
committed
test: fix github action tests
1 parent 098de29 commit 5ce9efe

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

vitest.config.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export default defineConfig({
66
include: ['lib/**/*.{test,spec}.ts'],
77
exclude: [
88
'lib/__tests__/mocks.ts',
9-
'lib/**/*.browser.{test,spec}.ts', // Exclude browser-specific tests
9+
'lib/**/*.browser.{test,spec}.ts', // Exclude browser-specific test
1010
],
1111
globals: true,
1212
coverage: {
@@ -22,6 +22,7 @@ export default defineConfig({
2222
deps: {
2323
inline: [/node:.*/],
2424
},
25+
setupFiles: ['./vitest.setup.ts'],
2526
},
2627
resolve: {
2728
alias: {

vitest.setup.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import { webcrypto } from 'node:crypto';
2+
3+
// Polyfill crypto for Node.js environment
4+
if (typeof global.crypto === 'undefined') {
5+
global.crypto = webcrypto as any;
6+
}

0 commit comments

Comments
 (0)