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

Mocking 'findByPk' not recognized by QueryInterface #11

Open
mgxmajewski opened this issue Oct 28, 2021 · 0 comments
Open

Mocking 'findByPk' not recognized by QueryInterface #11

mgxmajewski opened this issue Oct 28, 2021 · 0 comments

Comments

@mgxmajewski
Copy link

query: "findById",

Hi,

I'm having some issues mocking fakeModel while using 'findByPk' query.
I have changed query property value to "findByPk" in src/model.js and it works.
Guess double assignment on lines 407 and 408 doesn't solve the alias issue of findById and findByPk equivalance.

fakeModel.prototype.findById =
fakeModel.prototype.findByPk = async function (id) {
	var self = this;

	return await this.$query({
		query: "findByPk",

Cheers

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