Skip to content

Commit

Permalink
test: fix failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
thetutlage committed Oct 10, 2024
1 parent 9f669dd commit cd1e4d9
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions test/test_utils.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ import { AceFactory } from '@adonisjs/core/factories'

import DbSeed from '../commands/db_seed.js'
import { getDb } from '../test-helpers/index.js'
import Reset from '../commands/migration/reset.js'
import Migrate from '../commands/migration/run.js'
import DbTruncate from '../commands/db_truncate.js'
import Rollback from '../commands/migration/rollback.js'
import { AppFactory } from '@adonisjs/core/factories/app'
import { ApplicationService } from '@adonisjs/core/types'
import { DatabaseTestUtils } from '../src/test_utils/database.js'
Expand Down Expand Up @@ -129,22 +129,22 @@ test.group('Database Test Utils', () => {
await dbTestUtils.seed()
})

test('migrate() should run migration:run and migration:rollback commands', async ({
test('migrate() should run migration:run and migration:reset commands', async ({
fs,
assert,
}) => {
let migrationRun = false
let rollbackRun = false
let resetRun = false

class FakeMigrate extends Migrate {
override async run() {
migrationRun = true
}
}

class FakeMigrationRollback extends Rollback {
class FakeMigrationRollback extends Reset {
override async run() {
rollbackRun = true
resetRun = true
}
}

Expand All @@ -163,7 +163,7 @@ test.group('Database Test Utils', () => {
await rollback()

assert.isTrue(migrationRun)
assert.isTrue(rollbackRun)
assert.isTrue(resetRun)
})

test('migrate() with custom connectionName', async ({ fs, assert }) => {
Expand All @@ -175,7 +175,7 @@ test.group('Database Test Utils', () => {
}
}

class FakeMigrationRollback extends Rollback {
class FakeMigrationRollback extends Reset {
override async run() {
assert.equal(this.connection, 'secondary')
}
Expand Down

0 comments on commit cd1e4d9

Please sign in to comment.