Skip to content

Commit 85d1bff

Browse files
committed
test: remove obsolete vite-plugin tests and stub localStorage for collaboration tests
Removed tests that were testing the old @thread decorator approach: - scan-actors.ts and scan-actors.test.ts - generate-worker-entry.ts and generate-worker-entry.test.ts - dev-server.test.ts and plugin.test.ts - worker-entry-template.ts Added localStorage stub for collaboration package tests to fix failures caused by the @d-buckner/peer-pressure dependency checking for localStorage at module load time in Node.js environment. All tests now passing (373 tests across all packages).
1 parent b7fef3a commit 85d1bff

File tree

9 files changed

+16
-1453
lines changed

9 files changed

+16
-1453
lines changed
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
import { defineConfig } from 'vitest/config';
22

3-
43
export default defineConfig({
54
test: {
65
globals: true,
76
environment: 'node',
8-
setupFiles: ['./src/test-setup.ts'],
7+
setupFiles: ['./vitest.setup.ts', './src/test-setup.ts'],
98
},
109
});
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
/**
2+
* Global setup file that runs before any test files are loaded
3+
* Used to stub browser APIs that aren't available in Node.js
4+
*/
5+
6+
// Stub localStorage before any modules are loaded
7+
// Must be defined as actual methods, not arrow functions
8+
globalThis.localStorage = {
9+
getItem: function() { return null; },
10+
setItem: function() {},
11+
removeItem: function() {},
12+
clear: function() {},
13+
key: function() { return null; },
14+
length: 0,
15+
} as Storage;

packages/vite-plugin/src/dev-server.test.ts

Lines changed: 0 additions & 260 deletions
This file was deleted.

0 commit comments

Comments
 (0)