adonisjs / lucid

AdonisJS SQL ORM. Supports PostgreSQL, MySQL, MSSQL, Redshift, SQLite and many more
https://lucid.adonisjs.com/
MIT License
1.03k stars 189 forks source link

TestUtils truncate not working #897

Closed pataiadam closed 1 year ago

pataiadam commented 1 year ago

Hi,

I'm very new to Adonis, so sry if I'm asking dumb :)

I would like to use this documented truncate hook, after my tests are finished, but I can not reach this method :(

Documentation: https://docs.adonisjs.com/guides/testing/introduction#truncate-database-after-each-run-cycle

Package version

18.2.0

Node.js and npm version

18

Sample Code (to reproduce the issue)

export const runnerHooks: Required<Pick<Config, 'setup' | 'teardown'>> = {
  setup: [
    () => TestUtils.ace().loadCommands(),
    () => TestUtils.db().truncate()
  ],
  teardown: [],
}
RomainLanz commented 1 year ago

Hey @pataiadam! 👋🏻

Yes, it hasn't been released yet. It should be good later on today.

pataiadam commented 1 year ago

Oh that would be awesome 🙂 Thank you! 🥇

Julien-R44 commented 1 year ago

Was released with v18.3.0