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
578 B
17 lines
578 B
import { test } from 'node:test'
|
|
import assert from 'node:assert/strict'
|
|
|
|
import path from 'path'
|
|
import runMigrationSqlite from './../src/migration.js'
|
|
import getOrCreateSqlite from './../src/sqlite.js'
|
|
|
|
test('migration', async () => {
|
|
const db = getOrCreateSqlite({ 'uri': ':memory:', 'create': true, 'readwrite': true })
|
|
await runMigrationSqlite(path.join(path.resolve(), './resources'), db)
|
|
|
|
// check for boxes
|
|
const results = db.prepare("SELECT name FROM sqlite_master WHERE type='table' AND name='items'").get()
|
|
|
|
assert.equal(results.name, 'items')
|
|
})
|