diff --git a/packages/git-ci/test/daemon.test.js b/packages/git-ci/test/daemon.test.js index 9e8c80b..819c7af 100644 --- a/packages/git-ci/test/daemon.test.js +++ b/packages/git-ci/test/daemon.test.js @@ -161,6 +161,18 @@ describe('createStateStore', () => { chmodSync(readOnly, 0o700); }); + it('carries on with no warning callback at all', () => { + const readOnly = join(dir, 'locked-quiet'); + mkdirSync(readOnly); + chmodSync(readOnly, 0o500); + const store = createStateStore(join(readOnly, 'state.json')); + + expect(() => store.setCursor(SERVICE, 7)).not.toThrow(); + expect(store.cursor(SERVICE)).toBe(7); + + chmodSync(readOnly, 0o700); + }); + it('starts empty when the file is absent or unreadable', () => { const store = createStateStore(join(dir, 'missing', 'state.json')); expect(store.cursor(SERVICE)).toBeUndefined();