diff --git a/test/cli.spec.ts b/test/cli.spec.ts index 89562cf..d4642db 100644 --- a/test/cli.spec.ts +++ b/test/cli.spec.ts @@ -36,11 +36,12 @@ describe("CLI Options", function () { before(async () => { const gOpts = grantOptionsTM.map((g) => `-g "${g}"`).join(" "); + const mOpts = allMatches.map((m) => `-m "${m}"`).join(" "); const runs = await Promise.all([ aexec(`${cliPfx} tampermonkey -p ${pkg} -d --du ${requires[1]} -u ${requires[1]} -n testing -h ${requires[1]} --nf --ch "name1 value1" --ch name2`), aexec(`${cliPfx} violentmonkey -i "content" -p ${pkg} -o ${output} -d`), - aexec(`${cliPfx} tampermonkey -i "page" -p ${pkg} -o ${output} -d ${gOpts}`), + aexec(`${cliPfx} tampermonkey -i "page" -p ${pkg} -o ${output} -d ${gOpts} ${mOpts}`), aexec(`${cliPfx} tampermonkey -p ${pkg} -o ${output} -d`), aexec(`${cliPfx} violentmonkey -p ${pkg} -o ${output} -d -g all`), aexec(`${cliPfx} tampermonkey -m all -c -d`), @@ -135,12 +136,7 @@ describe("CLI Options", function () { }); it("-m options should correctly add @matches", async () => { - const mOpts = allMatches.map((m) => `-m "${m}"`).join(" "); - - const { stdout } = await aexec( - `${cliPfx} tampermonkey ${mOpts} -p ${pkg} -o ${output} -d` - ); - + const { stdout } = cliRuns[2]; const matched = stdout.match(/@match\s+(.+)/g) || []; expect(matched).length(allMatches.length); });