Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mock db.migrate functions #5487

Open
mlarcher opened this issue Feb 14, 2023 · 0 comments
Open

mock db.migrate functions #5487

mlarcher opened this issue Feb 14, 2023 · 0 comments

Comments

@mlarcher
Copy link

Environment

Knex version: 2.0.0

Questions about how to use knex

I want to mock knex.migrate.list or db.migrate.latest and so on to implement unit tests. Is there a way to do so ?
From what I gathered, it seems to me that each time we call knex.migrate a getter returns a new Migrator instance, preventing the spies/mocks from working

Is there any way around this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant