top of page

Jest-mock-static-method

None of them work. https://github.com/kepeterson/jest-mocking. Expected behavior. I am able to mock a static method on an ES6 class while ...












jest-mock-static-method


May 22, 2020 — For us to test this function, we may use a mock function, and then inspect the ... users.js import axios from 'axios'; class Users { static all() { return .... import {MockedClass} from './mocked-class'. jest.mock('./mocked-class');. describe​('TestClass', () => {. it ('should mock instance method', () => {.. One important note: function prototypes are handled specially by this mocking framework. For functions with prototypes, when called as a constructor, the mock will ... 939c2ea5af





1 view0 comments
bottom of page