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.js

16 lines
554 B

import { test } from 'node:test'
import assert from 'node:assert/strict'
import path from 'path'
import { runMigrationSqlite, getOrCreateSqlite } from '@nano/sqlite'
test('migration', async () => {
const db = getOrCreateSqlite({ 'uri': ':memory:', 'create': true, 'readwrite': true })
await runMigrationSqlite(path.resolve(path.resolve(), './src/migration'), db)
// check for boxes
const results = db.prepare("SELECT name FROM sqlite_master WHERE type='table' AND name='sessions'").get()
assert.equal(results.name, 'sessions')
})