@@ -257,14 +257,30 @@ ruleTester.run('prefer-snapshot-hint (multi)', rule, {
257
257
` ,
258
258
options : [ 'multi' ] ,
259
259
} ,
260
+ {
261
+ code : dedent `
262
+ describe('my tests', () => {
263
+ it('is true', () => {
264
+ expect(1).toMatchSnapshot('this is a hint, all by itself');
265
+ });
266
+
267
+ it('is false', () => {
268
+ expect(2).toMatchSnapshot('this is a hint');
269
+ expect(2).toMatchSnapshot('and so is this');
270
+ });
271
+ });
272
+ ` ,
273
+ options : [ 'multi' ] ,
274
+ } ,
260
275
{
261
276
code : dedent `
262
277
it('is true', () => {
263
278
expect(1).toMatchSnapshot();
264
279
});
265
280
266
281
it('is false', () => {
267
- expect(2).toMatchSnapshot();
282
+ expect(2).toMatchSnapshot('this is a hint');
283
+ expect(2).toMatchSnapshot('and so is this');
268
284
});
269
285
` ,
270
286
options : [ 'multi' ] ,
@@ -311,6 +327,18 @@ ruleTester.run('prefer-snapshot-hint (multi)', rule, {
311
327
` ,
312
328
options : [ 'multi' ] ,
313
329
} ,
330
+ {
331
+ code : dedent `
332
+ it('is true', () => {
333
+ expect(1).toMatchSnapshot();
334
+ });
335
+
336
+ it('is false', () => {
337
+ expect(1).toMatchSnapshot();
338
+ });
339
+ ` ,
340
+ options : [ 'multi' ] ,
341
+ } ,
314
342
{
315
343
code : dedent `
316
344
const myReusableTestBody = (value, snapshotHint) => {
@@ -606,6 +634,103 @@ ruleTester.run('prefer-snapshot-hint (multi)', rule, {
606
634
} ,
607
635
] ,
608
636
} ,
637
+ {
638
+ code : dedent `
639
+ describe('my tests', () => {
640
+ it('is true', () => {
641
+ expect(1).toMatchSnapshot();
642
+ });
643
+
644
+ it('is false', () => {
645
+ expect(2).toMatchSnapshot();
646
+ expect(2).toMatchSnapshot();
647
+ });
648
+ });
649
+ ` ,
650
+ options : [ 'multi' ] ,
651
+ errors : [
652
+ {
653
+ messageId : 'missingHint' ,
654
+ column : 15 ,
655
+ line : 7 ,
656
+ } ,
657
+ {
658
+ messageId : 'missingHint' ,
659
+ column : 15 ,
660
+ line : 8 ,
661
+ } ,
662
+ ] ,
663
+ } ,
664
+ {
665
+ code : dedent `
666
+ describe('my tests', () => {
667
+ it('is true', () => {
668
+ expect(1).toMatchSnapshot();
669
+ });
670
+
671
+ it('is false', () => {
672
+ expect(2).toMatchSnapshot();
673
+ expect(2).toMatchSnapshot('hello world');
674
+ });
675
+ });
676
+ ` ,
677
+ options : [ 'multi' ] ,
678
+ errors : [
679
+ {
680
+ messageId : 'missingHint' ,
681
+ column : 15 ,
682
+ line : 7 ,
683
+ } ,
684
+ ] ,
685
+ } ,
686
+ {
687
+ code : dedent `
688
+ describe('my tests', () => {
689
+ describe('more tests', () => {
690
+ it('is true', () => {
691
+ expect(1).toMatchSnapshot();
692
+ });
693
+ });
694
+
695
+ it('is false', () => {
696
+ expect(2).toMatchSnapshot();
697
+ expect(2).toMatchSnapshot('hello world');
698
+ });
699
+ });
700
+ ` ,
701
+ options : [ 'multi' ] ,
702
+ errors : [
703
+ {
704
+ messageId : 'missingHint' ,
705
+ column : 15 ,
706
+ line : 9 ,
707
+ } ,
708
+ ] ,
709
+ } ,
710
+ {
711
+ code : dedent `
712
+ describe('my tests', () => {
713
+ it('is true', () => {
714
+ expect(1).toMatchSnapshot();
715
+ });
716
+
717
+ describe('more tests', () => {
718
+ it('is false', () => {
719
+ expect(2).toMatchSnapshot();
720
+ expect(2).toMatchSnapshot('hello world');
721
+ });
722
+ });
723
+ });
724
+ ` ,
725
+ options : [ 'multi' ] ,
726
+ errors : [
727
+ {
728
+ messageId : 'missingHint' ,
729
+ column : 17 ,
730
+ line : 8 ,
731
+ } ,
732
+ ] ,
733
+ } ,
609
734
{
610
735
code : dedent `
611
736
const myReusableTestBody = (value, snapshotHint) => {
0 commit comments