Skip to content

Commit 4127fa6

Browse files
mysticateaaladdin-add
authored andcommitted
Chore: fix formatters/table test (#11534)
If standalone mocha command ran it, coloring caused to fail the tests.
1 parent b76bc00 commit 4127fa6

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

test.js

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,26 @@
88
// Requirements
99
//------------------------------------------------------------------------------
1010

11-
const assert = require("chai").assert,
12-
formatter = require("../../../lib/formatters/table");
11+
const assert = require("chai").assert;
12+
const chalk = require("chalk");
13+
const formatter = require("../../../lib/formatters/table");
1314

1415
//------------------------------------------------------------------------------
1516
// Tests
1617
//------------------------------------------------------------------------------
1718

1819
describe("formatter:table", () => {
20+
let originalChalkEnabled;
21+
22+
before(() => {
23+
originalChalkEnabled = chalk.enabled;
24+
chalk.enabled = false;
25+
});
26+
27+
after(() => {
28+
chalk.enabled = originalChalkEnabled;
29+
});
30+
1931
describe("when passed no messages", () => {
2032
const code = [
2133
{

0 commit comments

Comments
 (0)