@jameslnewell/buildkite-pipelines
Version:
Generate Buildkite pipelines from code.
37 lines (36 loc) • 1.54 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
const _CommandStep = require("./CommandStep");
const _GroupStep = require("./GroupStep");
describe(_GroupStep.GroupStep.name, ()=>{
const label = 'Testing Steps';
const step = new _CommandStep.CommandStep().addCommand('yarn run test');
test('has label key', async ()=>{
const group = new _GroupStep.GroupStep().setLabel(label).addStep(step);
const object = await group.build();
expect(object).toHaveProperty('label', label);
});
test('has group key', async ()=>{
const group = new _GroupStep.GroupStep().setLabel(label).addStep(step);
const object = await group.build();
expect(object).toHaveProperty('group', label);
});
test('has steps added various different ways', async ()=>{
const checkStep = new _CommandStep.CommandStep().addCommand('yarn run check');
const buildStep = new _CommandStep.CommandStep().addCommand('yarn run build');
const testStep = new _CommandStep.CommandStep().addCommand('yarn run test');
const group = new _GroupStep.GroupStep().setLabel(label).steps([
checkStep,
buildStep
]).addStep(testStep);
const object = await group.build();
expect(object).toHaveProperty('steps', expect.arrayContaining([
await checkStep.build(),
await buildStep.build(),
await testStep.build()
]));
});
});
//# sourceMappingURL=GroupStep.test.js.map