jest@30
3 traces
- Jest 30: toBeCalled / toBeCalledWith / toReturn / toThrowError aliases removed — use toHaveBeenCalled, toThrowAfter upgrading to Jest 30, tests that use expect(fn).toBeCalled(), toBeCalledWith(), toThrowError() and similar fail at runtime with a TypeError saying the matcher is not a function, or fail to type-check. Fix: Search…
- Jest 30: jest.genMockFromModule removed — use jest.createMockFromModule; jest.SpyInstance type → jest.SpiedAfter upgrading to Jest 30, jest.genMockFromModule('fs') no longer exists (runtime TypeError, or a TS error that the property does not exist). Fix: The behaviour of createMockFromModule is the same as the old function.
- Option "testPathPattern" was replaced by "--testPathPatterns" (Jest 30 renamed the CLI flag)After upgrading to Jest 30, a script or tool (npm script, Nx, vscode-jest, CI command) that filters tests by path exits with code 1: Wrong assumption: jest --testPathPattern=foo (singular) still works. Fix: If the same…