File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed
Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,34 @@ import base from "./vite.config.mjs";
99export default defineConfig ( {
1010 ...base ,
1111 root : "./" ,
12+ resolve : {
13+ alias : {
14+ "../internal/environment" : "/virtual:environment-mock" ,
15+ } ,
16+ } ,
17+ plugins : [
18+ ...( base . plugins || [ ] ) ,
19+ {
20+ name : "virtual-environment-mock" ,
21+ resolveId ( id ) {
22+ if ( id === "/virtual:environment-mock" ) {
23+ return id ;
24+ }
25+ } ,
26+ load ( id ) {
27+ if ( id === "/virtual:environment-mock" ) {
28+ // Simple stub - the actual values are mocked when testing
29+ return `
30+ export const THEME = "stub";
31+ export const PACKAGE_SOURCE = "stub";
32+ export const PACKAGE_VERSION = "stub";
33+ export const SYSTEM = "stub";
34+ export const ALWAYS_VISUAL_REFRESH = true;
35+ ` ;
36+ }
37+ } ,
38+ } ,
39+ ] ,
1240 test : {
1341 include : [ "./src/**/__tests__/**/*.test.{ts,tsx}" ] ,
1442 environment : "jsdom" ,
You can’t perform that action at this time.
0 commit comments