generated from hyper63/adapter-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmod.test.js
More file actions
34 lines (30 loc) · 779 Bytes
/
mod.test.js
File metadata and controls
34 lines (30 loc) · 779 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import { assert, validateFactorySchema } from './dev_deps.js'
import factory from './mod.js'
Deno.test({
name: 'mod',
sanitizeResources: false,
sanitizeOps: false,
fn: async (t) => {
await t.step({
name: 'should be a valid schema',
fn: () => {
assert(validateFactorySchema(factory()))
},
})
await t.step('load', async (t) => {
await t.step({
name: 'should accept a string',
fn: () => {
assert(factory('test/hyper-foo.db').load())
},
})
await t.step({
name: 'should accept an object with defaults',
fn: () => {
assert(factory({ dir: 'test' }).load())
assert(factory({ dir: 'test', name: 'foo.db' }).load())
},
})
})
},
})