Using Jest CLI v11.0.2, jasmine2, babel-jest

To be able to use snapshot testing you need to update Jest to 14 (you are using 11 atm)
Yep, thank you
I have this issue with jest 24.1.0 and yarn 1.13.0.
My test
import React from 'react';
import Adapter from 'enzyme-adapter-react-16';
import { shallow, configure } from 'enzyme';
import DocLink from '../doc_link';
configure({adapter: new Adapter()});
describe('DocLink', () => {
it('renders correctly', () => {
const url = 'https://bunkat.github.io/later/parsers.html#text';
const text = 'Schedule syntax';
const docLink = shallow(<DocLink url={url} text={text} />);
expect(docLink).toMatchSnapshot();
});
});
I tried to import expect but got the same error
import expect from 'expect';
and
const expect = require('expect');
@sergibondarenko expect doesn't have .toMatchSnapshot custom matcher installed by default, they're injected through test environment (see jestExpect.js files in Jest source). Use global expect and it will work.
Most helpful comment
To be able to use snapshot testing you need to update Jest to 14 (you are using 11 atm)