forked from hyoo-ru/mam_mol
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdb.test.ts
More file actions
40 lines (28 loc) · 783 Bytes
/
db.test.ts
File metadata and controls
40 lines (28 loc) · 783 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
35
36
37
38
39
40
namespace $ {
$mol_test({
async 'take and drop db'() {
const db = await $$.$mol_db( '$mol_db_test' )
await db.kill()
},
async 'make and drop store in separate migrations'() {
try {
const db1 = await $$.$mol_db( '$mol_db_test',
mig => mig.store_make( 'temp' ),
)
db1.destructor()
$mol_assert_like( db1.stores, [ 'temp' ] )
$mol_assert_like( db1.version, 2 )
const db2 = await $$.$mol_db( '$mol_db_test',
mig => mig.store_make( 'temp' ),
mig => mig.store_drop( 'temp' ),
)
db2.destructor()
$mol_assert_like( db2.stores, [] )
$mol_assert_like( db2.version, 3 )
} finally {
const db0 = await $$.$mol_db( '$mol_db_test' )
await db0.kill()
}
},
})
}