Skip to content

Commit

Permalink
Add test for ontology db creation
Browse files Browse the repository at this point in the history
  • Loading branch information
inukshuk committed May 9, 2024
1 parent d49a01d commit 42e7fe7
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions test/models/ontology_test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { join } from 'node:path'
import { Database } from '../../src/common/db.js'
import { mkdtmp } from '../support/tmp.js'
import mod from '../../src/models/ontology.js'

describe('models.ontology', () => {
let tmp = mkdtmp()

describe('create', () => {
it('creates a new ontology db from the schema', async () => {
let db = new Database(join(tmp, 'o.db'), 'w+')
await mod.create(db)

let { vocab } = await db.get('SELECT count(*) as vocab FROM vocabularies')
expect(vocab).to.be.greaterThan(10)
})
})
})

0 comments on commit 42e7fe7

Please sign in to comment.