Skip to content

Commit

Permalink
Update CIRCLECI environments to return level 3 color support (#157)
Browse files Browse the repository at this point in the history
  • Loading branch information
bjohnso5 authored Dec 18, 2024
1 parent b956653 commit 89a52f4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
4 changes: 2 additions & 2 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 => {
Expand Down

0 comments on commit 89a52f4

Please sign in to comment.