1
1
mirror of https://github.com/theoludwig/html-w3c-validator.git synced 2025-05-21 23:21:29 +02:00

refactor: simplify logic

This commit is contained in:
2024-02-02 14:47:31 +01:00
parent 2e0e136355
commit 09731d4749
11 changed files with 140 additions and 719 deletions

View File

@ -1,7 +1,9 @@
import test from "node:test"
import assert from "node:assert/strict"
import path from "node:path"
import fs from "node:fs"
import { PassThrough } from "node:stream"
import { fileURLToPath } from "node:url"
import sinon from "sinon"
import { execa } from "execa"
@ -33,7 +35,10 @@ await test("html-w3c-validator", async (t) => {
async () => {
const exampleURL = new URL("../../example", import.meta.url)
process.chdir(exampleURL.pathname)
await execa("rimraf", ["node_modules"])
await fs.promises.rm(
path.join(fileURLToPath(exampleURL), "node_modules"),
{ recursive: true, force: true },
)
await execa("npm", ["install"])
const { exitCode } = await execa("npm", [
"run",