You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
session/test/migration.test.ts

16 lines
563 B

3 months ago
import { expect, test } from 'bun:test'
import path from 'path'
import { runMigrationSqlite, getOrCreateSqlite } from '@nano/sqlite'
import { Database } from 'bun:sqlite'
test('migration', async () => {
const db = getOrCreateSqlite({ 'name': ':memory:', 'create': true, 'readwrite': true })
await runMigrationSqlite(path.resolve(__dirname, './../src/migration'), db)
// check for boxes
const results = db.query("SELECT name FROM sqlite_master WHERE type='table' AND name='sessions'").get()
expect(results).toEqual({ name: 'sessions' })
})