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.
sqlite/test/migration.test.ts

17 lines
564 B

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