mirror of
https://github.com/aljazceru/turso.git
synced 2026-01-15 06:04:19 +01:00
add one more test
This commit is contained in:
@@ -75,6 +75,21 @@ test('simple-db', async () => {
|
||||
await expect(async () => await db.pull()).rejects.toThrowError(/sync is disabled as database was opened without sync support/);
|
||||
})
|
||||
|
||||
test('reconnect-db', async () => {
|
||||
{
|
||||
const db = await connect({ path: 'local.db', url: process.env.VITE_TURSO_DB_URL });
|
||||
const stmt = db.prepare("SELECT * FROM turso_cdc");
|
||||
expect(await stmt.all()).toEqual([])
|
||||
stmt.close();
|
||||
}
|
||||
{
|
||||
const db = await connect({ path: 'local.db', url: process.env.VITE_TURSO_DB_URL });
|
||||
const stmt = db.prepare("SELECT * FROM turso_cdc");
|
||||
expect(await stmt.all()).toEqual([])
|
||||
stmt.close();
|
||||
}
|
||||
})
|
||||
|
||||
test('implicit connect', async () => {
|
||||
const db = new Database({ path: ':memory:', url: process.env.VITE_TURSO_DB_URL });
|
||||
const defer = db.prepare("SELECT * FROM not_found");
|
||||
|
||||
Reference in New Issue
Block a user