11import { delay , resolve } from "./deps.ts" ;
22import { PostgresMigrate } from "./postgres.ts" ;
3- import { assertEquals , test , TestSuite } from "./test_deps.ts" ;
3+ import { assertEquals , describe , it } from "./test_deps.ts" ;
44import {
55 cleanupInit ,
66 exampleMigrationsDir ,
@@ -9,14 +9,14 @@ import {
99} from "./test_postgres.ts" ;
1010import "./basic.ts" ;
1111
12- const applyTests = new TestSuite ( {
12+ const applyTests = describe < InitializedMigrateTest > ( {
1313 name : "apply" ,
14- async beforeEach ( context : InitializedMigrateTest ) {
15- context . migrate = new PostgresMigrate ( {
14+ async beforeEach ( ) {
15+ this . migrate = new PostgresMigrate ( {
1616 ...options ,
1717 migrationsDir : exampleMigrationsDir ,
1818 } ) ;
19- const { migrate } = context ;
19+ const { migrate } = this ;
2020 await cleanupInit ( migrate ) ;
2121 try {
2222 await migrate . connect ( ) ;
@@ -27,15 +27,16 @@ const applyTests = new TestSuite({
2727 await migrate . end ( ) ;
2828 }
2929 } ,
30- async afterEach ( { migrate } : InitializedMigrateTest ) {
31- await migrate . end ( ) ;
30+ async afterEach ( ) {
31+ await this . migrate . end ( ) ;
3232 } ,
3333} ) ;
3434
35- test (
35+ it (
3636 applyTests ,
3737 "creates migration table and applies all migrations" ,
38- async ( { migrate } ) => {
38+ async function ( ) {
39+ const { migrate } = this ;
3940 const process = Deno . run ( {
4041 cmd : [
4142 resolve ( migrate . migrationsDir , "../migrate_basic.ts" ) ,
7071 } ,
7172) ;
7273
73- test ( applyTests , "applies unapplied migrations" , async ( { migrate } ) => {
74+ it ( applyTests , "applies unapplied migrations" , async function ( ) {
75+ const { migrate } = this ;
7476 await migrate . connect ( ) ;
7577 await migrate . init ( ) ;
7678 await migrate . load ( ) ;
113115 }
114116} ) ;
115117
116- test ( applyTests , "no unapplied migrations" , async ( { migrate } ) => {
118+ it ( applyTests , "no unapplied migrations" , async function ( ) {
119+ const { migrate } = this ;
117120 await migrate . connect ( ) ;
118121 await migrate . init ( ) ;
119122 await migrate . load ( ) ;
0 commit comments