Skip to content

Commit 01d8518

Browse files
committed
core: add DhkemX25519HkdfSha256 test for browsers.
1 parent 4d0e8b1 commit 01d8518

File tree

7 files changed

+785
-16
lines changed

7 files changed

+785
-16
lines changed

.github/workflows/ci_browser.yml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,22 @@ jobs:
123123
runs-on: ubuntu-latest
124124
steps:
125125
- uses: actions/checkout@v4
126+
- uses: denoland/setup-deno@v2
127+
with:
128+
deno-version: 2.x
126129
- uses: actions/setup-node@v4
127-
- working-directory: ./packages/core/test/runtimes/browsers
128-
run: npm install && npx playwright install-deps && npx playwright install && npx playwright test
130+
with:
131+
node-version: 22
132+
- name: Install dependencies
133+
run: |
134+
npm install -g esbuild
135+
- name: Run dnt
136+
run: deno task dnt
137+
- working-directory: ./packages/core
138+
run: |
139+
deno task minify > test/runtimes/browsers/pages/src/hpke-core.js
140+
cd test/runtimes/browsers
141+
npm ci && npx playwright install-deps && npx playwright install && npx playwright test
129142
- working-directory: ./packages/dhkem-x25519/test/runtimes/browsers
130143
run: npm install && npx playwright install-deps && npx playwright install && npx playwright test
131144
- working-directory: ./packages/dhkem-x448/test/runtimes/browsers
Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,21 @@
11
import { expect, test } from "@playwright/test";
22

33
test("basic test", async ({ page }) => {
4-
await page.goto("https://dajiaji.github.io/hpke-js/core");
4+
await page.goto("./index.html");
55
await page.click("text=run");
66
await page.waitForTimeout(5000);
77
await expect(page.locator("id=pass")).toHaveText("18");
88
await expect(page.locator("id=fail")).toHaveText("0");
99
});
10+
11+
test("secure curves test", async ({ browserName, page }) => {
12+
test.skip(
13+
browserName === "webkit",
14+
"Secure curves are not supported in Safari",
15+
);
16+
await page.goto("./secure_curves.html");
17+
await page.click("text=run");
18+
await page.waitForTimeout(5000);
19+
await expect(page.locator("id=pass")).toHaveText("6");
20+
await expect(page.locator("id=fail")).toHaveText("0");
21+
});

0 commit comments

Comments
 (0)