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 a5696ac commit 2ab96b4Copy full SHA for 2ab96b4
tests/verify.ts
@@ -217,7 +217,7 @@ export const ensureFileRegexMatches = (
217
218
export const ensureDocxRegexMatches = (
219
file: string,
220
- regexes: RegExp[],
+ regexes: (string | RegExp)[],
221
): Verify => {
222
return {
223
name: "Inspecting Docx for Regex matches",
@@ -234,6 +234,9 @@ export const ensureDocxRegexMatches = (
234
const docXml = join(temp, "word", "document.xml");
235
const tex = await Deno.readTextFile(docXml);
236
regexes.forEach((regex) => {
237
+ if (typeof regex === "string") {
238
+ regex = new RegExp(regex);
239
+ }
240
assert(
241
regex.test(tex),
242
`Required DocX Element ${String(regex)} is missing.`,
0 commit comments