-
Notifications
You must be signed in to change notification settings - Fork 210
Expand file tree
/
Copy pathintegration.test.ts
More file actions
23 lines (20 loc) · 987 Bytes
/
Copy pathintegration.test.ts
File metadata and controls
23 lines (20 loc) · 987 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import {WriteStreamsMock} from "../../../src/write-streams.js";
import {handler} from "../../../src/handler.js";
import fs from "fs-extra";
import {initSpawnSpy} from "../../mocks/utils.mock.js";
import {WhenStatics} from "../../mocks/when-statics.js";
beforeAll(() => {
initSpawnSpy(WhenStatics.all);
});
test.concurrent("cache-directives <test-job> --shell-isolation --needs", async () => {
await fs.rm("tests/test-cases/cache-directives/.gitlab-ci-local/cache/", {recursive: true, force: true});
const writeStreams = new WriteStreamsMock();
await handler({
cwd: "tests/test-cases/cache-directives",
job: ["test-job"],
noColor: true,
shellIsolation: true,
}, writeStreams);
await expect(fs.pathExists("tests/test-cases/cache-directives/.gitlab-ci-local/cache/default/cache/file1.txt")).resolves.toBe(true);
expect(writeStreams.stdoutLines.join("\n")).toContain("cache/**.txt: found 1 artifact files and directories");
});