@@ -27,6 +27,13 @@ ruleTester.run('conditional expressions', rule, {
2727 };
2828 });
2929 ` ,
30+ dedent `
31+ it.each()('foo', function () {
32+ const foo = function (bar) {
33+ return foo ? bar : null;
34+ };
35+ });
36+ ` ,
3037 ] ,
3138 invalid : [
3239 {
@@ -120,6 +127,11 @@ ruleTester.run('switch statements', rule, {
120127 switch('bar') {}
121128 })
122129 ` ,
130+ dedent `
131+ describe.skip.each()('foo', () => {
132+ switch('bar') {}
133+ })
134+ ` ,
123135 dedent `
124136 xdescribe('foo', () => {
125137 switch('bar') {}
@@ -501,6 +513,13 @@ ruleTester.run('if statements', rule, {
501513 });
502514 })
503515 ` ,
516+ dedent `
517+ describe.each\`\`('foo', () => {
518+ afterEach(() => {
519+ if('bar') {}
520+ });
521+ })
522+ ` ,
504523 dedent `
505524 describe('foo', () => {
506525 beforeEach(() => {
@@ -826,6 +845,20 @@ ruleTester.run('if statements', rule, {
826845 } ,
827846 ] ,
828847 } ,
848+ {
849+ code : dedent `
850+ it.each()('foo', () => {
851+ callExpression()
852+ if ('bar') {}
853+ })
854+ ` ,
855+ errors : [
856+ {
857+ data : { condition : 'if' } ,
858+ messageId : 'conditionalInTest' ,
859+ } ,
860+ ] ,
861+ } ,
829862 {
830863 code : dedent `
831864 it.only.each\`\`('foo', () => {
@@ -840,6 +873,20 @@ ruleTester.run('if statements', rule, {
840873 } ,
841874 ] ,
842875 } ,
876+ {
877+ code : dedent `
878+ it.only.each()('foo', () => {
879+ callExpression()
880+ if ('bar') {}
881+ })
882+ ` ,
883+ errors : [
884+ {
885+ data : { condition : 'if' } ,
886+ messageId : 'conditionalInTest' ,
887+ } ,
888+ ] ,
889+ } ,
843890 {
844891 code : dedent `
845892 describe('valid', () => {
0 commit comments