Skip to content

Commit f4eed7b

Browse files
committed
fix: ci error
1 parent 45b9cfe commit f4eed7b

2 files changed

Lines changed: 9 additions & 11 deletions

File tree

.github/workflows/pr.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
- name: "Install pnpm"
2020
uses: pnpm/action-setup@v4
2121
with:
22-
version: 9
22+
version: 10
2323

2424
- name: "Run Test with Coverage"
2525
run: |

worker/test/ssr.spec.ts

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,31 +23,29 @@ describe("SSR Display Page", () => {
2323
expect(html).toContain('<div id="root">')
2424
expect(html).toContain(name) // Title should contain paste name
2525

26-
// LIMITATION: SSR fails in Workers test environment due to @heroui/input-otp module resolution issue
27-
// See: UPSTREAM_ISSUE.md and INPUT_OTP_ISSUE.md
28-
// In test environment, SSR falls back to CSR (returns static display.html)
29-
// In production, SSR works correctly and embeds serialized data
26+
// LIMITATION: SSR fails in Workers test environment due to module resolution
27+
// The input-otp package cannot be resolved in Workers runtime during dynamic import
28+
// In production, SSR works correctly. In tests, it falls back to CSR.
29+
// This is a known limitation of the Cloudflare Workers test environment.
3030

31-
// Check if SSR succeeded (has serialized data) or fell back to CSR (static HTML)
31+
// Verify the page is functional (either SSR or CSR fallback)
3232
const hasSerializedData = html.includes("__PASTE_DATA__")
3333

3434
if (hasSerializedData) {
3535
// SSR succeeded - verify data is properly embedded
3636
expect(html).toContain("application/json")
3737
expect(html).toContain("window.__PASTE_DATA__")
3838

39-
// Extract and verify serialized data
4039
const match = /<script id="__PASTE_DATA__" type="application\/json">(.*?)<\/script>/.exec(html)
4140
expect(match).toBeTruthy()
4241

4342
const data = JSON.parse(match![1]) as { name: string; content: string; metadata: unknown }
4443
expect(data.name).toBe(name)
45-
expect(data.content).toBeTruthy() // Base64 encoded content
44+
expect(data.content).toBeTruthy()
4645
expect(data.metadata).toBeTruthy()
4746
} else {
48-
// SSR failed, fell back to CSR - this is expected in test environment
49-
// Verify CSR fallback works correctly
50-
expect(html).toContain("display") // Should have display.js
47+
// CSR fallback - verify it loads correctly
48+
expect(html).toContain("display")
5149
expect(html).toContain(".js")
5250
}
5351
})

0 commit comments

Comments
 (0)