Skip to content

Commit 2ab96b4

Browse files
committed
take strings as input to work in smoke-all
1 parent a5696ac commit 2ab96b4

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

tests/verify.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ export const ensureFileRegexMatches = (
217217

218218
export const ensureDocxRegexMatches = (
219219
file: string,
220-
regexes: RegExp[],
220+
regexes: (string | RegExp)[],
221221
): Verify => {
222222
return {
223223
name: "Inspecting Docx for Regex matches",
@@ -234,6 +234,9 @@ export const ensureDocxRegexMatches = (
234234
const docXml = join(temp, "word", "document.xml");
235235
const tex = await Deno.readTextFile(docXml);
236236
regexes.forEach((regex) => {
237+
if (typeof regex === "string") {
238+
regex = new RegExp(regex);
239+
}
237240
assert(
238241
regex.test(tex),
239242
`Required DocX Element ${String(regex)} is missing.`,

0 commit comments

Comments
 (0)