We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I am using sequelize mock v5 to mock User model.
// user.test.js import User from "../models/user"; // original user model class jest.mock("../models/user", () => () => { const SequelizeMock = require("sequelize-mock-v5"); const dbMock = new SequelizeMock(); return dbMock.define("User", { id: 111, username: "myusername" }); }); test("blabla", async () => { const r = await User.findOne({ where: { id:1 }}); // expectations here });
This gives me
TypeError: _user.default.findOne is not a function
Here is the original User model which I am trying to mock.
// /models/user.js export default class User extends Model {...}
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I am using sequelize mock v5 to mock User model.
This gives me
Here is the original User model which I am trying to mock.
The text was updated successfully, but these errors were encountered: