adonisjs / core

AdonisJS is a TypeScript-first web framework for building web apps and API servers. It comes with support for testing, modern tooling, an ecosystem of official packages, and more.

Home Page:https://adonisjs.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

TypeError: testUtils.db is not a function

sam-ngu opened this issue · comments

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

nevermind, I was using lucid v19, this feature was recently added in lucid v20.1.