'ReferenceError: jasmine is not defined
I noticed a lot of answers is to install jest-jasmine2 and add testRunner: 'jasmine2' into jest.test.config.
I added this, but it is still not working. Below is my test case:
it('test', async () => {
const submitForm = jest.fn();
const st = mount(
<MyComponent
{...{ submitForm }}
/>,
);
st.find('form').simulate('submit');
expect(submitForm).toHaveBeenCalledWith({ isValid: false, values: jasmine.anything() });
});
Error: ReferenceError: jasmine is not defined
91 | await nextTick();
92 |
> 93 | expect(**submitForm**).toHaveBeenCalledWith({ isValid: false, values: jasmine.anything() });
| ^
94 | });
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
