File tree Expand file tree Collapse file tree 2 files changed +14
-6
lines changed
Expand file tree Collapse file tree 2 files changed +14
-6
lines changed Original file line number Diff line number Diff line change 11import { vi } from 'vitest' ;
2- import * as svelteinternal from 'svelte/internal' ;
32
43beforeAll ( ( ) => {
54 vi . mock ( '$app/environment' , ( ) => ( {
65 browser : true
76 } ) ) ;
8- vi . mock ( '$app/stores' , ( ) => ( {
9- page : null
10- } ) ) ;
117 vi . mock ( '$app/navigation' , ( ) => ( {
128 goto : vi . fn ( )
139 } ) ) ;
14- vi . mock ( 'svelte' , ( ) => svelteinternal ) ;
1510} ) ;
Original file line number Diff line number Diff line change @@ -17,6 +17,14 @@ const config = {
1717 } ,
1818 server : {
1919 port : 3000
20+ }
21+ } ;
22+
23+ /** @type {import('vite').UserConfig } */
24+ const testConfig = {
25+ resolve : {
26+ // hotfix for https://github.com/vitest-dev/vitest/issues/2834
27+ conditions : [ 'browser' ]
2028 } ,
2129 test : {
2230 include : [ 'tests/**/*.test.ts' ] ,
@@ -30,4 +38,9 @@ const config = {
3038 }
3139} ;
3240
33- export default config ;
41+ export default process . env . VITEST
42+ ? {
43+ ...config ,
44+ ...testConfig
45+ }
46+ : config ;
You can’t perform that action at this time.
0 commit comments