Skip to content

Commit

Permalink
test: applying changeset when database is not open results in exception
Browse files Browse the repository at this point in the history
  • Loading branch information
louwers committed Aug 3, 2024
1 parent af7371b commit c049c41
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions test/parallel/test-sqlite.js
Original file line number Diff line number Diff line change
Expand Up @@ -808,4 +808,17 @@ test('trying to create changeset when database is closed results in exception',
name: 'Error',
message: 'database is not open',
});
});

test('trying to apply a changeset when database is closed results in exception', (t) => {
const database = new DatabaseSync(':memory:');
const session = database.createSession();
const changeset = session.changeset();
database.close();
t.assert.throws(() => {
database.applyChangeset(changeset);
}, {
name: 'Error',
message: 'database is not open',
});
});

0 comments on commit c049c41

Please sign in to comment.