Skip to content

Commit 11e5db5

Browse files
authored
test(cli): add --color test (#1784)
1 parent 99b78dc commit 11e5db5

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

test/cli.test.js

+12
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,18 @@ describe('CLI', () => {
5959
.catch(done);
6060
});
6161

62+
it('--color', (done) => {
63+
runDevServer('--color')
64+
.then((output) => {
65+
// https://github.com/webpack/webpack-dev-server/blob/master/lib/utils/colors.js
66+
expect(
67+
output.stdout.includes('\u001b[39m \u001b[90m「wds」\u001b[39m:')
68+
).toEqual(true);
69+
done();
70+
})
71+
.catch(done);
72+
});
73+
6274
it('should exit the process when SIGINT is detected', (done) => {
6375
const cliPath = path.resolve(__dirname, '../bin/webpack-dev-server.js');
6476
const examplePath = path.resolve(__dirname, '../examples/cli/public');

0 commit comments

Comments
 (0)