[Tech Debt] Update canvas-standalone.test.ts mock state with gamepad properties

Open Beginner friendly
#590 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
1/5
Estimated time
Under an hour
Newbie friendliness
75/100
Issue type
Refactor
Clarity
Clearly specified
Activity status
Stale
Tech stack
typescript
Domain
testing

Research direction

Open packages/export/tests/runtime/canvas-standalone.test.ts and inspect the mock CanvasRuntimeState object at lines 35-53. Compare it with the properties introduced by PR #588, then run the relevant canvas standalone test or the package test suite. Done means the mock includes the required gamepad state fields and the tests still pass.

Written by the indexing model from the issue text.

Description

tech-debt

Description

The test file's mock CanvasRuntimeState object is missing the previousGamepadButtons and currentGamepadStates properties added in PR #588. This could cause TypeScript errors if tests are expanded.

Location

Changes Needed

Add to the mock state object:

previousGamepadButtons: [[], [], [], []],
currentGamepadStates: [
  createEmptyGamepadState(),
  createEmptyGamepadState(),
  createEmptyGamepadState(),
  createEmptyGamepadState(),
],

Found In

PR #588 - fix: Poll gamepad state once per frame in export runtime

Priority

P3-Low - tests still pass, this is preventive maintenance

Dominant language
TypeScript
Stars
1
Forks
0
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from jcollard/LuaInTheWeb

All issues in jcollard/LuaInTheWeb

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.