File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -109,6 +109,7 @@ export const loadRstackConfig = async (): Promise<Configs> => {
109109 await loadConfig ( {
110110 loader : 'native' ,
111111 exportName : false ,
112+ fresh : true ,
112113 ...( state . configPath !== undefined
113114 ? { path : state . configPath }
114115 : {
Original file line number Diff line number Diff line change 1+ import { define } from 'rstack' ;
2+
3+ define . app ( { } ) ;
Original file line number Diff line number Diff line change @@ -2,13 +2,19 @@ import path from 'node:path';
22import { expect , test } from 'rstack/test' ;
33import { getConfigState , loadRstackConfig } from '../../../src/config.ts' ;
44
5- test ( 'should reset config state before and after loading ' , async ( ) => {
5+ test ( 'should load config with fresh state ' , async ( ) => {
66 const state = getConfigState ( ) ;
77 state . configs = { app : { } } ;
8- state . configPath = path . join ( import . meta. dirname , 'rstack .config.ts' ) ;
8+ state . configPath = path . join ( import . meta. dirname , 'fresh .config.ts' ) ;
99
1010 try {
11- await expect ( loadRstackConfig ( ) ) . rejects . toThrow ( 'test config error' ) ;
11+ expect ( await loadRstackConfig ( ) ) . toHaveProperty ( 'app' ) ;
12+ expect ( await loadRstackConfig ( ) ) . toHaveProperty ( 'app' ) ;
13+
14+ state . configs = { app : { } } ;
15+ state . configPath = path . join ( import . meta. dirname , 'rstack.config.ts' ) ;
16+
17+ await expect ( loadRstackConfig ( ) ) . rejects . toThrow ( ) ;
1218 expect ( state . configs ) . toEqual ( { } ) ;
1319 } finally {
1420 state . configs = { } ;
You can’t perform that action at this time.
0 commit comments