smartci/test/test.ts

23 lines
617 B
TypeScript
Raw Permalink Normal View History

2018-02-26 19:02:11 +00:00
import { tap, expect } from 'tapbundle';
import * as smartci from "../ts/index";
2016-03-22 23:12:17 +00:00
process.env.TRAVIS_JOB_NUMBER = "180.3";
process.env.CI = "true";
2018-02-26 19:02:11 +00:00
tap.test("should state if we are in a CI environment", async () => {
expect(smartci.isCi()).to.be.true();
process.env.CI = "false";
expect(smartci.isCi()).to.be.false();
});
tap.test("should state if we are dealing with a tagged commit", async () => {
delete process.env[ "CI_BUILD_TAG" ];
expect(smartci.isTaggedCommit()).to.be.false();
process.env.CI_BUILD_TAG = "3.1.2";
expect(smartci.isTaggedCommit()).to.be.true();
})
tap.start()