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.
17 lines
586 B
17 lines
586 B
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 })
|
|
await runMigrationSqlite(path.join(__dirname, './../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' })
|
|
})
|