i have created a jest test file below.But the snapshot for this file is not created. What is the issue in my code?
import React from 'react';
import Carousel from './component';
import renderer from 'react-test-renderer';
test('Carousel Component Test Suite', () => {
const component = renderer.create(
<Carousel
/>
);
let tree = component.toJSON();
expect(tree).toMatchSnapshot();
});
You have to update the test case. Fire the command below in command prompt/terminal etc.
npm test -u YourTest.spec.js
Do this in project root directory.
I ran it locally (swapping in a simple component) and it generated a .snap file.
As far as I can see everything looks fine but it may be a problem with a specific version of a dependency you're using (but without seeing your package.json it's impossible to say).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With