Skip to content

refactor(test): use direct await over resolves assertion style - #32

Merged
amondnet merged 1 commit into
mainfrom
refactor/test-assertion-style
Mar 12, 2026
Merged

amondnet merged 1 commit into
mainfrom
refactor/test-assertion-style

Conversation

@amondnet

@amondnet amondnet commented Mar 12, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Replace await expect(fn()).resolves.toBeUndefined() with expect(await fn()).toBeUndefined() in workspace.test.ts
  • Cleaner and more idiomatic async assertion style in Bun/Jest test runner

Test plan

  • Existing tests pass: bun run test:app

Summary by cubic

Refactored workspace.test.ts to replace await expect(...).resolves.toBeUndefined() with expect(await ...).toBeUndefined() for clearer async assertions. No behavior change; improves readability and aligns with our test style.

Written for commit 177951e. Summary will update on new commits.

Replace `await expect(...).resolves.toBeUndefined()` with
`expect(await ...).toBeUndefined()` for cleaner async test assertions.
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request refactors the asynchronous assertion style in workspace.test.ts to adopt a more direct and idiomatic approach. The change aims to improve the readability and maintainability of tests by directly awaiting the function call before asserting its result, aligning with common practices in Bun/Jest test environments.

Highlights

  • Test Assertion Style Refactor: Replaced await expect(fn()).resolves.toBeUndefined() with expect(await fn()).toBeUndefined() for cleaner asynchronous test assertions in workspace.test.ts.
Changelog
  • apps/work-please/src/workspace.test.ts
    • Updated asynchronous test assertions to use expect(await fn()).toBeUndefined() instead of await expect(fn()).resolves.toBeUndefined().
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩

@dosubot dosubot Bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Mar 12, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request refactors asynchronous test assertions in workspace.test.ts. The change from await expect(...).resolves to expect(await ...) is a good stylistic improvement that enhances readability and aligns with modern testing practices. The changes are correct and have been applied consistently. I have no further suggestions.

@amondnet amondnet self-assigned this Mar 12, 2026
@amondnet
amondnet merged commit afa77bf into main Mar 12, 2026
2 checks passed
@amondnet
amondnet deleted the refactor/test-assertion-style branch March 12, 2026 12:42
@dosubot dosubot Bot added the type:test Testing improvements or additions label Mar 12, 2026

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 1 file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS This PR changes 0-9 lines, ignoring generated files. type:test Testing improvements or additions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant