From f16af439694aab473c647d8fae47c402bd489447 Mon Sep 17 00:00:00 2001 From: Toru Nagashima Date: Fri, 22 Mar 2019 21:19:48 +0900 Subject: [PATCH] Chore: fix formatters/table test (#11534) If standalone mocha command ran it, coloring caused to fail the tests. --- tests/lib/formatters/table.js | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/tests/lib/formatters/table.js b/tests/lib/formatters/table.js index 667d1b7a43c..6354fcbc258 100644 --- a/tests/lib/formatters/table.js +++ b/tests/lib/formatters/table.js @@ -8,14 +8,26 @@ // Requirements //------------------------------------------------------------------------------ -const assert = require("chai").assert, - formatter = require("../../../lib/formatters/table"); +const assert = require("chai").assert; +const chalk = require("chalk"); +const formatter = require("../../../lib/formatters/table"); //------------------------------------------------------------------------------ // Tests //------------------------------------------------------------------------------ describe("formatter:table", () => { + let originalChalkEnabled; + + before(() => { + originalChalkEnabled = chalk.enabled; + chalk.enabled = false; + }); + + after(() => { + chalk.enabled = originalChalkEnabled; + }); + describe("when passed no messages", () => { const code = [ {