-
Notifications
You must be signed in to change notification settings - Fork 210
Expand file tree
/
Copy pathintegration.test.ts
More file actions
34 lines (31 loc) · 1.12 KB
/
Copy pathintegration.test.ts
File metadata and controls
34 lines (31 loc) · 1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import {WriteStreamsMock} from "../../../src/write-streams.js";
import {handler} from "../../../src/handler.js";
const cwd = "tests/test-cases/project-ignores-file";
const ignoresFile = "gitlab-ci-local-ignores-test-job";
test.concurrent("project-no-ignores-file", async () => {
const writeStreams = new WriteStreamsMock();
const stateDir = ".gitlab-ci-local-no-ignores-file";
await handler({
cwd,
job: ["test-job"],
noColor: true,
stateDir,
variable: [`STATE_DIR=${stateDir}`],
}, writeStreams);
const expected = ["test-job > 2"];
expect(writeStreams.stdoutLines).toEqual(expect.arrayContaining(expected));
});
test.concurrent("project-ignores-file", async () => {
const writeStreams = new WriteStreamsMock();
const stateDir = ".gitlab-ci-local-ignores-file";
await handler({
cwd,
job: ["test-job"],
ignoresFile,
noColor: true,
stateDir,
variable: [`STATE_DIR=${stateDir}`],
}, writeStreams);
const expected = ["test-job > 1"];
expect(writeStreams.stdoutLines).toEqual(expect.arrayContaining(expected));
});