What is the significance of 1 written in every export statement of a snapshot test?

74 views Asked by At

Why 1 is written with export statement, like here renders correctly 1

exports[`renders correctly 1`] = `
<h1>
  Facebook
</h1>
`;
1

There are 1 answers

0
user8152190 On

I found it myself the answer to this question.

Here. the number signifies if we have the same name for two snapshots, then this number is changed. Like above, if I have another snapshot test with the same name as it('renders correctly'), then It will have the snapshot as below:

exports[`renders correctly 2`] = `
<h1>
  Facebook
</h1>
`;