Skip to content

test: replace non-null assertions in page action tests with a lookup helper - #58

Draft
eli7pm wants to merge 1 commit into
runwayml:mainfrom
eli7pm:test/page-action-tool-helper
Draft

eli7pm wants to merge 1 commit into
runwayml:mainfrom
eli7pm:test/page-action-tool-helper

Conversation

@eli7pm

@eli7pm eli7pm commented Nov 20, 2026 •

Copy link
Copy Markdown

Summary

page-actions.test.ts looked up tools with pageActionTools.find(...)!, which triggers three lint/style/noNonNullAssertion warnings from bun run lint.

This adds a small helper, getPageActionTool(name), in packages/core/src/utils/. It returns the tool with that name, or throws Missing page action tool: <name> if there isn't one. The test now uses it in place of the three assertions, so a missing tool fails with a clear message instead of a TypeError on undefined.

The helper is only used by tests. It isn't exported from the package and doesn't end up in the built bundles.

Changes

  • packages/core/src/utils/getPageActionTool.ts: new helper
  • packages/core/src/utils/getPageActionTool.test.ts: tests for the helper (finds by name, returns the same object as pageActionTools, throws on an unknown name)
  • packages/core/src/api/page-actions.test.ts: uses the helper instead of find(...)!

Testing

  • bun test packages/core/src/api/page-actions.test.ts packages/core/src/utils/getPageActionTool.test.ts: 12 pass
  • cd packages/core && bun run typecheck: clean
  • biome lint on the changed files: no warnings

…helper

Add getPageActionTool, which finds a page action tool by name and throws
a descriptive error if it's missing, and use it in page-actions.test.ts
instead of `find(...)!`. Clears the lint/style/noNonNullAssertion
warnings in that file.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Nov 20, 2026

Copy link
Copy Markdown

@eli7pm is attempting to deploy a commit to the Runway Team on Vercel.

A member of the Team first needs to authorize it.

This branch has not been deployed

No deployments
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.

1 participant