Skip to content

Commit 89a52f4

Browse files
authored
Update CIRCLECI environments to return level 3 color support (#157)
1 parent b956653 commit 89a52f4

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

index.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -124,11 +124,11 @@ function _supportsColor(haveStream, {streamIsTTY, sniffFlags = true} = {}) {
124124
}
125125

126126
if ('CI' in env) {
127-
if ('GITHUB_ACTIONS' in env || 'GITEA_ACTIONS' in env) {
127+
if (['GITHUB_ACTIONS', 'GITEA_ACTIONS', 'CIRCLECI'].some(key => key in env)) {
128128
return 3;
129129
}
130130

131-
if (['TRAVIS', 'CIRCLECI', 'APPVEYOR', 'GITLAB_CI', 'BUILDKITE', 'DRONE'].some(sign => sign in env) || env.CI_NAME === 'codeship') {
131+
if (['TRAVIS', 'APPVEYOR', 'GITLAB_CI', 'BUILDKITE', 'DRONE'].some(sign => sign in env) || env.CI_NAME === 'codeship') {
132132
return 1;
133133
}
134134

test.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -191,10 +191,10 @@ test('return true if `TRAVIS` is in env', async t => {
191191
t.truthy(result.stdout);
192192
});
193193

194-
test('return true if `CIRCLECI` is in env', async t => {
194+
test('return level 3 if `CIRCLECI` is in env', async t => {
195195
process.env = {CI: true, CIRCLECI: true};
196196
const result = await importMain();
197-
t.truthy(result.stdout);
197+
t.is(result.stdout.level, 3);
198198
});
199199

200200
test('return true if `APPVEYOR` is in env', async t => {

0 commit comments

Comments
 (0)