You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The fixtures should reflect the parsing logic and edge cases should be implemented visibly as over write.
Before:
exportfunctionconfig(outputDir='tmp'): CoreConfig{return{persist: { outputDir },// ...}};it('should throw if outputDir is invalid',()=>{constpersistConfigMock=persistConfig({outputDir : ' '});expect(()=>persistConfigSchema.parse(persistConfigMock)).toThrow(`path is invalid`,);});
This is not in sync with the logic like default, validation etc in schemas. A change later already fail in the mock and we have to use visible overwrites for invalid data.
After:
exportfunctionconfig(outputDir='tmp'): CoreConfig{return{persist: persistConfigSchema.parse({ outputDir }),// ...}};it('should throw if outputDir is invalid',()=>{constpersistConfigMock=persistConfig();persistConfigMock.outputDir=' ';expect(()=>persistConfigSchema.parse(persistConfigMock)).toThrow(`path is invalid`,);});
Activity