Skip to content

Commit

Permalink
Remove "del" dependency from tests, simplify use of "cpy" dependency …
Browse files Browse the repository at this point in the history
…in tests.
  • Loading branch information
DavidAnson committed Jan 5, 2025
1 parent af14a2e commit 7c796b1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@
"chalk": "5.4.1",
"cpy": "11.1.0",
"cpy-cli": "5.0.0",
"del": "8.0.0",
"eslint": "9.17.0",
"eslint-plugin-jsdoc": "50.6.1",
"eslint-plugin-n": "17.15.1",
Expand Down
16 changes: 7 additions & 9 deletions test/markdownlint-cli2-test-cases.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import fs from "node:fs/promises";
import os from "node:os";
import path from "node:path";
import test from "ava";
import cpy from "cpy";
import { __dirname } from "./esm-helpers.mjs";

const noop = () => null;
Expand Down Expand Up @@ -140,16 +141,13 @@ const testCases = ({

const directoryName = (dir) => `${dir}-copy-${host}`;

const copyDirectory = (dir, alt) => import("cpy").then((cpy) => (
cpy.default(
path.join(__dirname(import.meta), (alt || dir), "**"),
path.join(__dirname(import.meta), directoryName(dir))
)
));
const copyDirectory = (dir, alt) => cpy(
path.join(__dirname(import.meta), (alt || dir), "**"),
path.join(__dirname(import.meta), directoryName(dir))
);

const deleteDirectory = (dir) => import("del").then((del) => (
del.deleteAsync(path.join(__dirname(import.meta), directoryName(dir)))
));
const deleteDirectory = (dir) =>
fs.rm(path.join(__dirname(import.meta), directoryName(dir)), { "recursive": true });

testCase({
"name": "no-arguments",
Expand Down

0 comments on commit 7c796b1

Please sign in to comment.