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