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
565 B
17 lines
565 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({ 'name': ':memory:', 'create': true, 'readwrite': true })
|
||
|
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' })
|
||
|
})
|