Skip to content

Wrong sql request generated using include, with a basic association example (only with Jest !) #17167

Discussion options

You must be logged in to vote

A long time to find out that the problem was only occurring in the jest tests.

And the responsible is here : jest.resetModules();

-> If you encounter a similar issue with a weird behaviour of sequelize with jest, just do not reset the modules, or find an alternative method to reset only what you want.

Why ?

I do not know. It could be a bug, or perhaps not. Maybe someone reading this will have the answer.

In my opinion, it is a bug. Because everything works fine (eager fetch one -> many with hasMany, associations, BelongsToGetAssociation, etc.), but not the eager fetch many -> one (belongsTo).

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@WikiRik
Comment options

@clemzangrilli
Comment options

Answer selected by clemzangrilli
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants