Skip to content

fix(koa): use non-null assertion for ctxStorage instanceof check in tests#5854

Closed
Copilot wants to merge 1 commit intofeat/snapshot-koafrom
copilot/sub-pr-5851
Closed

fix(koa): use non-null assertion for ctxStorage instanceof check in tests#5854
Copilot wants to merge 1 commit intofeat/snapshot-koafrom
copilot/sub-pr-5851

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 31, 2026

Snapshot test assertions against ctxStorage required narrowing the nullable AsyncLocalStorage<Context> | null type before calling instanceof. Without the non-null assertion, TypeScript rejects the comparison since null is not an instance of anything.

Changes

  • packages/koa/test/application/snapshot.test.ts — Add ! non-null assertions on ctxStorage accesses used in instanceof AsyncLocalStorage checks, matching the deliberate nullable typing introduced in the parent snapshot PR.

Copilot AI changed the title [WIP] Defer AsyncLocalStorage creation for V8 startup snapshot support fix(koa): use non-null assertion for ctxStorage instanceof check in tests Mar 31, 2026
Copilot AI requested a review from killagu March 31, 2026 02:44
@killagu killagu closed this Mar 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants