I have a mocked class of a node module and its method as below, and test case to test case I need to change the methodOne
returning value.
jest.mock("module_name", () => {
return {
__esModule: true,
Abc: class Abc {
constructor(config) {}
async methodOne(params) {
return {
message: {
content:
This text I need to change ,
},
};
}
},
Configuration: class Configuration {
constructor(config) {
return true;
}
},
};
});
describe("getVeganStatus", () => {
it("should handle case one......", async () => {
// methodOne message.content return value should be "ABC"
})
it("should handle case two......", async () => {
// methodOne message.content return value should be "XYZ"
});
})```