Skip to content

TypeError: testUtils.db is not a function #4384

@sam-ngu

Description

@sam-ngu

Package version

6.2.2

Describe the bug

Hi there, I was following the v6 docs to run tests against my db.

Under https://docs.adonisjs.com/guides/database-tests, the docs mentioned testUtils.db() provides some database helper utilities, eg .migrate() and truncate().

However I get this error:

TypeError: testUtils.db is not a function

Upon investigating the source code in https://github.com/adonisjs/core/blob/develop/src/test_utils/main.ts, I couldn't find the relevant db() function.

Am I doing something wrong here? Or is this feature hasn't been implemented in v6 yet?

Reproduction repo

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions