mirror of
https://github.com/pezkuwichain/pwap.git
synced 2026-04-22 02:07:55 +00:00
fix(test): add polyfill shims for vitest environment
This commit is contained in:
@@ -0,0 +1,2 @@
|
||||
import { Buffer } from 'buffer';
|
||||
export default Buffer;
|
||||
@@ -0,0 +1 @@
|
||||
export default globalThis;
|
||||
@@ -0,0 +1 @@
|
||||
export default { env: {} };
|
||||
@@ -10,6 +10,11 @@ export default defineConfig(() => ({
|
||||
globals: true,
|
||||
environment: 'jsdom',
|
||||
setupFiles: './src/tests/setup.ts',
|
||||
alias: {
|
||||
'vite-plugin-node-polyfills/shims/buffer': path.resolve(__dirname, './src/tests/mocks/buffer-shim.ts'),
|
||||
'vite-plugin-node-polyfills/shims/global': path.resolve(__dirname, './src/tests/mocks/global-shim.ts'),
|
||||
'vite-plugin-node-polyfills/shims/process': path.resolve(__dirname, './src/tests/mocks/process-shim.ts'),
|
||||
},
|
||||
},
|
||||
server: {
|
||||
host: "::",
|
||||
|
||||
Reference in New Issue
Block a user