We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 56da834 commit 261e514Copy full SHA for 261e514
tests/verify.ts
@@ -180,9 +180,18 @@ export const ensureHtmlElements = (
180
181
export const ensureFileRegexMatches = (
182
file: string,
183
- matches: RegExp[],
184
- noMatches?: RegExp[],
+ matchesUntyped: (string | RegExp)[],
+ noMatchesUntyped?: (string | RegExp)[],
185
): Verify => {
186
+ const asRegexp = (m: string | RegExp) => {
187
+ if (typeof m === "string") {
188
+ return new RegExp(m);
189
+ } else {
190
+ return m;
191
+ }
192
+ };
193
+ const matches = matchesUntyped.map(asRegexp);
194
+ const noMatches = noMatchesUntyped?.map(asRegexp);
195
return {
196
name: `Inspecting ${file} for Regex matches`,
197
verify: async (_output: ExecuteOutput[]) => {
0 commit comments