fix: harden store writes, strict schemas, null cfg
This commit is contained in:
@@ -69,4 +69,18 @@ describe('readConfigFile', () => {
|
||||
expect(readConfigFile(path)).toEqual([])
|
||||
expect(console.error).toHaveBeenCalled()
|
||||
})
|
||||
|
||||
it('warns on null config', () => {
|
||||
const path = join(dir, 'config.json')
|
||||
writeFileSync(path, 'null')
|
||||
expect(readConfigFile(path)).toEqual([])
|
||||
expect(console.error).toHaveBeenCalled()
|
||||
})
|
||||
|
||||
it('warns on primitive config', () => {
|
||||
const path = join(dir, 'config.json')
|
||||
writeFileSync(path, '"just a string"')
|
||||
expect(readConfigFile(path)).toEqual([])
|
||||
expect(console.error).toHaveBeenCalled()
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user