-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.js
32 lines (27 loc) · 835 Bytes
/
test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
'use strict';
var assert = require('power-assert');
var isTravisCiBuildForTag = require('./');
it('should not travis-ci build for tag', function () {
delete process.env.TRAVIS_TAG;
delete process.env.TRAVIS;
delete process.env.CI;
assert.equal(isTravisCiBuildForTag(), false);
});
it('treat empty value as false', function () {
process.env.TRAVIS_TAG = '';
process.env.TRAVIS = 1;
process.env.CI = 1;
assert.equal(isTravisCiBuildForTag(), false);
});
it('treat falsy value as false', function () {
process.env.TRAVIS_TAG = 'false';
process.env.TRAVIS = 1;
process.env.CI = 1;
assert.equal(isTravisCiBuildForTag(), false);
});
it('should travis-ci build for tag', function () {
process.env.TRAVIS_TAG = 1;
process.env.TRAVIS = 1;
process.env.CI = 1;
assert.equal(isTravisCiBuildForTag(), true);
});