Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,7 @@
"pkg-ok": "^3.0.0",
"pretty-bytes": "^7.0.0",
"rimraf": "^6.0.1",
"server-destroy": "^1.0.1",
"strip-ansi": "^7.1.0"
"server-destroy": "^1.0.1"
},
"dependencies": {
"@nodesecure/documentation-ui": "^1.3.0",
Expand Down
6 changes: 3 additions & 3 deletions test/commands/summary.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ dotenv.config();
import { fileURLToPath } from "node:url";
import path from "node:path";
import { describe, it } from "node:test";
import { stripVTControlCharacters } from "node:util";

// Import Third-party Dependencies
import stripAnsi from "strip-ansi";
import * as i18n from "@nodesecure/i18n";

// Import Internal Dependencies
Expand Down Expand Up @@ -47,7 +47,7 @@ describe("CLI Commands: summary", () => {
for await (const line of runProcess(processOptions)) {
const regexp = lines.shift();
t.assert.ok(regexp, "we are expecting this line");
t.assert.ok(regexp.test(stripAnsi(line)), `line (${line}) matches ${regexp}`);
t.assert.ok(regexp.test(stripVTControlCharacters(line)), `line (${line}) matches ${regexp}`);
}
});

Expand All @@ -66,7 +66,7 @@ describe("CLI Commands: summary", () => {

for await (const line of runProcess(processOptions)) {
const expectedLineRegex = expectedLines.shift();
const formattedLine = stripAnsi(line);
const formattedLine = stripVTControlCharacters(line);
t.assert.ok(expectedLineRegex, "we are expecting this line");
t.assert.ok(expectedLineRegex.test(formattedLine), `line (${formattedLine}) should match ${expectedLineRegex}`);
}
Expand Down
4 changes: 2 additions & 2 deletions test/helpers/cliCommandRunner.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// Import Node.js Dependencies
import { fork } from "node:child_process";
import { createInterface } from "node:readline";
import { stripVTControlCharacters } from "node:util";

// Import Third-party Dependencies
import { MockAgent, setGlobalDispatcher } from "undici";
import stripAnsi from "strip-ansi";

export async function* runProcess(options) {
const { path, args = [], cwd = process.cwd(), undiciMockAgentOptions = null } = options;
Expand All @@ -20,7 +20,7 @@ export async function* runProcess(options) {
const rStream = createInterface(childProcess.stdout);

for await (const line of rStream) {
yield stripAnsi(line);
yield stripVTControlCharacters(line);
}
}
finally {
Expand Down