mirror of
https://github.com/deepseek-ai/deepseek-harness
synced 2026-08-15 21:04:50 +00:00
test(settings): make invalid watcher edit atomic
This commit is contained in:
@@ -397,7 +397,9 @@ describe('watch', () => {
|
||||
const ctx = await boot({ path, debounceMs: 10 })
|
||||
const scope = ctx.settings.register(settingsNamespace('ui-theme'), ThemeSchema)
|
||||
|
||||
await writeFile(path, 'ui-theme: [unclosed\n')
|
||||
// Replace the external edit atomically so this case observes one complete
|
||||
// invalid document instead of a transient empty file during truncation.
|
||||
await writeFileAtomic(path, 'ui-theme: [unclosed\n', { mode: 0o600 })
|
||||
// The bad edit must never take the live tree down or reset the value.
|
||||
await new Promise(resolve => setTimeout(resolve, 300))
|
||||
expect(scope.get()).toEqual({ theme: 'light', fontSize: 14 })
|
||||
|
||||
Reference in New Issue
Block a user