@jameslnewell/buildkite-pipelines
Version:
Generate Buildkite pipelines from code.
31 lines • 1.37 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const WaitStep_1 = require("./WaitStep");
describe(WaitStep_1.WaitStep.name, () => {
describe('.wait', () => {
const wait = new WaitStep_1.WaitStep();
expect(wait.build()).toHaveProperty('wait', null);
});
describe('.continue_on_failure', () => {
test('defaults to undefined', () => {
expect(new WaitStep_1.WaitStep().build()).not.toHaveProperty('continue_on_failure');
});
test('set to true when set on the object', () => {
expect(new WaitStep_1.WaitStep().setContinueOnFailure(true).build()).toHaveProperty('continue_on_failure', true);
});
test('set to false when set on the object', () => {
expect(new WaitStep_1.WaitStep().setContinueOnFailure(false).build()).toHaveProperty('continue_on_failure', false);
});
});
test('has key', async () => {
const key = 'main';
const wait = new WaitStep_1.WaitStep().setKey(key);
expect((await wait.build()).key).toEqual(key);
});
test('has condition', async () => {
const condition = 'build.branch == "main"';
const wait = new WaitStep_1.WaitStep().setCondition(condition);
expect((await wait.build()).if).toEqual(condition);
});
});
//# sourceMappingURL=WaitStep.test.js.map