mirror of
https://github.com/svg/svgo.git
synced 2025-07-29 20:21:14 +03:00
Replace strip-ansi with --no-color flag (#1588)
nanocolors checks for --color and --no-color flags to force or disable output coloring. Which can be used instead of strip-ansi package which btw introduced vulnerability recently.
This commit is contained in:
@ -1,10 +1,9 @@
|
||||
'use strict';
|
||||
|
||||
const { spawn } = require('child_process');
|
||||
const stripAnsi = require('strip-ansi');
|
||||
|
||||
test('should exit with 1 code on syntax error', async () => {
|
||||
const proc = spawn('node', ['../../bin/svgo', 'invalid.svg'], {
|
||||
const proc = spawn('node', ['../../bin/svgo', '--no-color', 'invalid.svg'], {
|
||||
cwd: __dirname,
|
||||
});
|
||||
const [code, stderr] = await Promise.all([
|
||||
@ -20,7 +19,7 @@ test('should exit with 1 code on syntax error', async () => {
|
||||
}),
|
||||
]);
|
||||
expect(code).toEqual(1);
|
||||
expect(stripAnsi(stderr))
|
||||
expect(stderr)
|
||||
.toEqual(`SvgoParserError: invalid.svg:2:27: Unquoted attribute value
|
||||
|
||||
1 | <svg>
|
||||
|
Reference in New Issue
Block a user