@jameslnewell/buildkite-pipelines
Version:
Generate Buildkite pipelines from code.
38 lines (37 loc) • 1.08 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
const _validate = require("./validate");
describe(_validate.validate.name, ()=>{
test('returns 0 errors when valid', async ()=>{
const errors = await (0, _validate.validate)({
steps: []
});
expect(errors);
});
test('returns >0 errors when invalid', async ()=>{
const errors = await (0, _validate.validate)({
steps: [
{
foo: 'bar'
}
]
});
expect(errors.length).toBeGreaterThan(0);
});
test('returns structured errors when invalid', async ()=>{
const errors = await (0, _validate.validate)({
steps: [
{
command: 'echo "Hello World!"',
timeout_in_minutes: 0
}
]
});
expect(errors).toContainEqual(expect.objectContaining({
message: 'must be >= 1'
}));
});
});
//# sourceMappingURL=validate.test.js.map