Skip to content

Fix skipped test: useGitHub "throw when branchName missing" (source returns null, not throws) #49

Description

@nojibe

Problem

The "throw when branchName missing" test in src/app/sandbox/hooks/useGitHub.test.ts is broken and currently .skipped. The test expects the hook to throw when branchName is missing, but the current source returns null instead — so the assertion fails.

Like the other skipped test, this was already failing on main and only surfaced because unit suites weren't run in CI. It was marked .skip (not deleted) during the Jest→Vitest migration (#45 / PR #46). With CI now running the suites (#33 / PR #47), the mismatch should be resolved.

Task

Decide which behavior is correct and align the two:

  • If throwing is correct (missing branchName is a programmer error): update the source to throw and keep/adjust the test.
  • If returning null is correct (graceful no-op): update the test to assert the null/no-op behavior and rename it accordingly.

Then remove the .skip and confirm it passes under pnpm test:web.

Acceptance criteria

  • Source and test agree on the missing-branchName contract, and the decision is intentional
  • The test is un-skipped, renamed if the behavior is "returns null", and passing
  • pnpm test:web green

References

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions