From da86bb635ecbd0580a75c26a03b59cece38a6d58 Mon Sep 17 00:00:00 2001 From: JonasBa Date: Mon, 21 Oct 2024 21:42:12 -0400 Subject: [PATCH] fix test --- src/rules/noLookAheadLookBehindRegExp.test.ts | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/rules/noLookAheadLookBehindRegExp.test.ts b/src/rules/noLookAheadLookBehindRegExp.test.ts index e6df382..3edf083 100644 --- a/src/rules/noLookAheadLookBehindRegExp.test.ts +++ b/src/rules/noLookAheadLookBehindRegExp.test.ts @@ -23,9 +23,19 @@ const groups = [ tester.run("noLookaheadLookbehindRegexp", noLookaheadLookbehindRegexp, { valid: [ // dont flag string values when they are not used in combination with RegExp - ...groups.map((g) => `var str = "(${g.expression}foo)"`), + ...groups.map((g) => { + return { + name: `valid-${g.type}`, + code: `var str = "(${g.expression}foo)"`, + }; + }), // dont flag escaped sequences - ...groups.map((g) => `/\\(${g})/g`), + ...groups.map((g) => { + return { + name: `valid-escaped-${g.type}`, + code: `/\\(${g.expression})/g`, + }; + }), ], invalid: [ // When initializing with a literal @@ -84,7 +94,7 @@ tester.run("Caniuse: noLookaheadLookbehindRegexp", noLookaheadLookbehindRegexp, settings: { browser: "Chrome 96, Firefox 96" }, }; }), - ...groups.map((g) => `/\\(${g})/g`), + ...groups.map((g) => `/\\(${g.expression})/g`), ], invalid: [ {