Skip to content

Commit e87466b

Browse files
committed
test: add more tests for E2E.ts
1 parent af8ac8c commit e87466b

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

src/lib/e2e/E2E.spec.ts

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,36 @@ describe("assert", () => {
9292
})
9393
})
9494

95+
describe("expect()", () => {
96+
it("should return true on identical values", () => {
97+
expect(E2E.expect(mocks.envContext, "value", "value")).toBeTruthy()
98+
})
99+
it("should return true on identical values", () => {
100+
expect(
101+
E2E.expect(mocks.envContext, "value", "non-matching-value"),
102+
).toBeFalsy()
103+
})
104+
})
105+
106+
describe("statusMapFromResults()", () => {
107+
it("should create a status map from results", () => {
108+
expect(
109+
E2E.statusMapFromResults([
110+
{ level: "assertion", status: E2EStatus.ERROR },
111+
{ level: "assertion", status: E2EStatus.FAILED },
112+
{ level: "assertion", status: E2EStatus.SKIPPED },
113+
{ level: "assertion", status: E2EStatus.SUCCESS },
114+
{ level: "assertion", status: E2EStatus.SUCCESS },
115+
]),
116+
).toMatchObject({
117+
error: 1,
118+
failed: 1,
119+
skipped: 1,
120+
success: 2,
121+
})
122+
})
123+
})
124+
95125
describe("overallStatus", () => {
96126
it("should decide to skipped", () => {
97127
expect(

0 commit comments

Comments
 (0)