Skip to content

Commit

Permalink
fix lints in test
Browse files Browse the repository at this point in the history
  • Loading branch information
gvilums committed Apr 15, 2024
1 parent 68faeb5 commit 71b46bb
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions test/js/bun/sqlite/sqlite.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -883,11 +883,12 @@ it("close() should NOT throw an error if the database is in use", () => {

it("should dispose AND throw an error if the database is in use", () => {
expect(() => {
let prepared;
{
using db = new Database(":memory:");
db.exec("CREATE TABLE foo (id INTEGER PRIMARY KEY AUTOINCREMENT, name TEXT)");
db.exec("INSERT INTO foo (name) VALUES ('foo')");
var prepared = db.prepare("SELECT * FROM foo");
prepared = db.prepare("SELECT * FROM foo");
}
}).toThrow("database is locked");
});
Expand All @@ -903,8 +904,8 @@ it("should dispose", () => {
});

it("can continue to use existing statements after database has been GC'd", async () => {
var called = false;
var registry = new FinalizationRegistry(() => {
let called = false;
const registry = new FinalizationRegistry(() => {
called = true;
});
function leakTheStatement() {
Expand Down Expand Up @@ -939,10 +940,11 @@ it("statements should be disposable", () => {

it("query should work if the cached statement was finalized", () => {
{
let prevQuery;
using db = new Database("mydb.sqlite");
{
using query = db.query("select 'Hello world' as message;");
var prevQuery = query;
prevQuery = query;
query.get();
}
{
Expand Down

0 comments on commit 71b46bb

Please sign in to comment.