1 | initial version |
To make the argument of Jest Mock Service assignable, you can do the following:
const mockService = jest.fn();
test('Test case 1', () => {
//...code...
mockService(argument);
//...assertions...
});
mockService.mockImplementation(() => 'mocked value');
This will change the returned value of the mocked function to 'mocked value'.
Overall, by assigning the Jest Mock Service to a variable, you can easily pass it as an argument to test cases and modify its behavior as needed.