What do you want to save?
Add Code snippet
New code examples
-
Javascript 2022-03-27 14:35:09
jest mock restore
test("mockFn.mockReset", () => { const mockFn = jest.fn().mockImplementation(() => 43); const MockClass = jest.fn(); new MockClass(); expect(mockFn()).toBe(43); expect(mockFn.mock.calls).toHaveLength(1); expect(MockClass.mock... Add solution -
TypeScript 2022-02-17 11:50:06
tsconfig configuration
//type config configuration { "compilerOptions": { "outDir": "dist", "target": "ESNext", "module": "CommonJS", "moduleResolution": "node", "esModuleI... Add solution -
Javascript 2022-02-11 04:35:13
mock a function jest react
import React from 'react'; import { render } from '@testing-library/react'; import '@testing-library/jest-dom/extend-expect' import App from './App'; import { randomNameGenerator } from "./utils"; jest.mock('./utils.js', () => ({ randomN... Add solution
Best helpers
+10
+5
+5
+5
+5
+5
+5
+5
+5
+5