diff --git a/index.js b/index.js index 85dabbb..b22d50e 100644 --- a/index.js +++ b/index.js @@ -124,11 +124,11 @@ function _supportsColor(haveStream, {streamIsTTY, sniffFlags = true} = {}) { } if ('CI' in env) { - if ('GITHUB_ACTIONS' in env || 'GITEA_ACTIONS' in env) { + if (['GITHUB_ACTIONS', 'GITEA_ACTIONS', 'CIRCLECI'].some(key => key in env)) { return 3; } - if (['TRAVIS', 'CIRCLECI', 'APPVEYOR', 'GITLAB_CI', 'BUILDKITE', 'DRONE'].some(sign => sign in env) || env.CI_NAME === 'codeship') { + if (['TRAVIS', 'APPVEYOR', 'GITLAB_CI', 'BUILDKITE', 'DRONE'].some(sign => sign in env) || env.CI_NAME === 'codeship') { return 1; } diff --git a/test.js b/test.js index 4de3180..6ce6fbe 100644 --- a/test.js +++ b/test.js @@ -191,10 +191,10 @@ test('return true if `TRAVIS` is in env', async t => { t.truthy(result.stdout); }); -test('return true if `CIRCLECI` is in env', async t => { +test('return level 3 if `CIRCLECI` is in env', async t => { process.env = {CI: true, CIRCLECI: true}; const result = await importMain(); - t.truthy(result.stdout); + t.is(result.stdout.level, 3); }); test('return true if `APPVEYOR` is in env', async t => {