forked from jamesward/easyracer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlib.test.js
30 lines (26 loc) · 1.05 KB
/
lib.test.js
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
import {GenericContainer, Wait} from "testcontainers"
import * as lib from "./lib.js"
describe("all work", () => {
let container
beforeAll(async () => {
container = await new GenericContainer("ghcr.io/jamesward/easyracer")
.withExposedPorts(8080)
.withWaitStrategy(Wait.forHttp("/", 8080))
.start()
}, 15000);
afterAll(async () => {
await container.stop()
})
it("works", async () => {
const httpPort = container.getFirstMappedPort()
expect(await lib.scenario1(httpPort)).toBe("right")
expect(await lib.scenario2(httpPort)).toBe("right")
expect(await lib.scenario3(httpPort)).toBe("right")
expect(await lib.scenario4(httpPort)).toBe("right")
expect(await lib.scenario5(httpPort)).toBe("right")
expect(await lib.scenario6(httpPort)).toBe("right")
expect(await lib.scenario7(httpPort)).toBe("right")
expect(await lib.scenario8(httpPort)).toBe("right")
expect(await lib.scenario9(httpPort)).toBe("right")
}, 600000)
})