UNPKG

singularci

Version:

SingularCI is a DSL transpiler used to generate CI/CD configuration files for existing CI platforms

24 lines 1.2 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); const Job_1 = __importDefault(require("../../src/SemanticModel/Job")); const Run_1 = __importDefault(require("./../../src/SemanticModel/Tasks/Run")); const Checkout_1 = __importDefault(require("./../../src/SemanticModel/Tasks/Checkout")); it('should be possible to get the name of a job', () => { const jobName = 'jobName'; const job = new Job_1.default(jobName, []); expect(job.getName()).toBe(jobName); }); it('should be possible to get the tasks of a job', () => { const jobName = 'jobName'; const runFactory = new Run_1.default(); const checkoutFactory = new Checkout_1.default(); const task1 = runFactory.createRunTask(['echo "This is a test task"']); const task2 = checkoutFactory.createCheckoutTask('fake-repo.remote.git', 'repoName'); const job = new Job_1.default(jobName, [task1, task2]); expect(job.getTasks()).toContain(task1); expect(job.getTasks()).toContain(task2); }); //# sourceMappingURL=Job.test.js.map