From 3fad07a09f8241d4d02c0d7f7ba8daeab2ebd5c9 Mon Sep 17 00:00:00 2001 From: David Anson Date: Wed, 27 Nov 2024 15:25:29 -0800 Subject: [PATCH] wip --- test/markdownlint-cli2-test-exec.mjs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/test/markdownlint-cli2-test-exec.mjs b/test/markdownlint-cli2-test-exec.mjs index ce77a7c..2574921 100644 --- a/test/markdownlint-cli2-test-exec.mjs +++ b/test/markdownlint-cli2-test-exec.mjs @@ -3,6 +3,7 @@ import fs from "node:fs/promises"; import path from "node:path"; import test from "ava"; +import spawn from "nano-spawn"; import testCases from "./markdownlint-cli2-test-cases.mjs"; import { __dirname } from "./esm-helpers.mjs"; @@ -11,7 +12,6 @@ const repositoryPath = (name) => path.join(__dirname(import.meta), "..", name); const invoke = (directory, args, noRequire, env, script) => async () => { await fs.access(directory); - const { "default": spawn } = await import("nano-spawn"); return spawn( "node", [ @@ -41,9 +41,8 @@ testCases({ "includeAbsolute": true }); -const invokeStdin = async (args, stdin, cwd) => { - const { "default": spawn } = await import("nano-spawn"); - return spawn( +const invokeStdin = (args, stdin, cwd) => ( + spawn( "node", [ repositoryPath("markdownlint-cli2-bin.mjs"), @@ -53,8 +52,8 @@ const invokeStdin = async (args, stdin, cwd) => { cwd, "stdin": { "string": stdin } } - ); -}; + ) +); const validInput = "# Heading\n\nText\n"; const invalidInput = "# Heading\n\nText";