-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.test.js
More file actions
30 lines (25 loc) · 907 Bytes
/
index.test.js
File metadata and controls
30 lines (25 loc) · 907 Bytes
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
const aws = require("./aws");
const docker = require("./docker");
test("ecr getToken fake region throw err", async () => {
await expect(aws.getAuthToken("fake-region")).rejects.toThrow(
"Inaccessible host: `api.ecr.fake-region.amazonaws.com' at port `undefined'. This service may not be available in the `fake-region' region."
);
});
test("ecr getToken ok", async () => {
await aws.getAuthToken("eu-west-1");
});
test("docker login", async () => {
const { username, password, registryUri } = await aws.getAuthToken(
"eu-west-1"
);
await docker.dockerLogin(username, password, registryUri);
});
jest.setTimeout(30000);
test("docker build", async () => {
await docker.dockerBuild("test:latest", "./.tests/Dockerfile");
});
test("test injection", async () => {
await expect(
docker.dockerBuild("test:latest", "./.tests/Dockerfile", ". ; touch toto")
).rejects.toThrow();
});