test(busted): disable colors in test-runner output #15610

Problem
-------

Because test/busted/outputHandlers/nvim.lua doesn't know if it's running
in a terminal (no "isatty" equivalent), it outputs color codes in CI
logs and local tooling that runs the tests in a pipe:

    [1m[ SKIPPED ] 

This is just noise, hard for humans to read.

Solution
--------

Disable the color codes. If we later find a clever way to detect
a terminal in nvim.lua, we might consider re-enabling colors, but that
would still affect the CI build logs...
This commit is contained in:
Justin M. Keyes 2021-09-09 09:18:43 -07:00 committed by GitHub
parent 422198cde6
commit 13748512f6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,15 +1,9 @@
local pretty = require 'pl.pretty'
local global_helpers = require('test.helpers')
local colors
local isWindows = package.config:sub(1,1) == '\\'
if isWindows then
colors = setmetatable({}, {__index = function() return function(s) return s end end})
else
colors = require 'term.colors'
end
-- Colors are disabled. #15610
-- To enable: `local colors = require 'term.colors'`
local colors = setmetatable({}, {__index = function() return function(s) return s end end})
return function(options)
local busted = require 'busted'