Permalink
Browse files

support the `CI` environment variable

  • Loading branch information...
1 parent 6e90111 commit 9170da93dde30a88040b388176628b482bf64515 @sindresorhus sindresorhus committed May 22, 2016
Showing with 7 additions and 1 deletion.
  1. +1 −1 index.js
  2. +6 −0 test.js
View
@@ -46,7 +46,7 @@ var supportLevel = (function () {
return 1;
}
- if ('TEAMCITY_VERSION' in process.env) {
+ if ('CI' in process.env || 'TEAMCITY_VERSION' in process.env) {
return 0;
}
View
@@ -127,6 +127,12 @@ it('should allow tests of the properties on false', function () {
assert.equal(result.level > 0, false);
});
+it('should return false if `CI` is in env', function () {
+ process.env.CI = 'Travis';
+ var result = requireUncached('./');
+ assert.equal(Boolean(result), false);
+});
+
it('should return false if `TEAMCITY_VERSION` is in env', function () {
process.env.TEAMCITY_VERSION = '9.0.5 (build 32523)';
var result = requireUncached('./');

0 comments on commit 9170da9

Please sign in to comment.