Skip to content

Commit 071264d

Browse files
committed
Add status test
1 parent 8e7f7dc commit 071264d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

test/lifecycle.test.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,21 @@ describe('Lifecycle', () => {
55
it('should open and close database', () =>
66
dbRunner({ skipOpen: true }, async ({ db }) => {
77
expect(db.isOpen()).toBe(false);
8+
expect(db.status).toBe('closed');
89

910
db.close(); // noop
1011

1112
db.open();
1213
db.open(); // noop
1314

1415
expect(db.isOpen()).toBe(true);
16+
expect(db.status).toBe('open');
1517
expect(db.get('foo')).toBeUndefined();
1618

1719
db.close();
1820

1921
expect(db.isOpen()).toBe(false);
22+
expect(db.status).toBe('closed');
2023

2124
await expect(db.get('foo')).rejects.toThrow('Database not open');
2225
}));

0 commit comments

Comments
 (0)