Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
JonasBa committed Oct 22, 2024
1 parent 0988522 commit da86bb6
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions src/rules/noLookAheadLookBehindRegExp.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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: [
{
Expand Down

0 comments on commit da86bb6

Please sign in to comment.