smartci/test/test.ts

26 lines
897 B
TypeScript
Raw Permalink Normal View History

import "typings-test";
2016-03-22 23:12:17 +00:00
var smartci = require("../dist/index.js");
var should = require("should");
process.env.TRAVIS_JOB_NUMBER = "180.3";
process.env.CI = "true";
describe("smartci",function(){
describe("check",function(){
describe(".isCi",function(){
it("should state if we are in a CI environment",function(){
smartci.isCi().should.be.true();
2016-03-22 23:12:17 +00:00
process.env.CI = "false";
smartci.isCi().should.be.false();
2016-03-22 23:12:17 +00:00
});
});
describe(".isTaggedCommit",function(){
it("should state if we are dealing with a tagged commit",function(){
2016-07-27 23:32:53 +00:00
delete process.env["CI_BUILD_TAG"];
smartci.isTaggedCommit().should.be.false();
process.env.CI_BUILD_TAG = "3.1.2";
smartci.isTaggedCommit().should.be.true();
2016-03-22 23:12:17 +00:00
})
});
});
});