Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(exp): fail test when mock calls were expected but not received #542

Merged
merged 1 commit into from
Oct 31, 2024

Conversation

jooola
Copy link
Member

@jooola jooola commented Oct 31, 2024

Ensure test failure when some call were expected, but were not received.

e.g. we have a single mocked request, but the test does not generate any call, the test should fail.

@jooola jooola requested a review from a team as a code owner October 31, 2024 11:36
@jooola jooola force-pushed the mock-expected-more-calls branch from 8b1da72 to 725b1a1 Compare October 31, 2024 11:36
Copy link

codecov bot commented Oct 31, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 67.52%. Comparing base (09a582a) to head (725b1a1).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #542      +/-   ##
==========================================
+ Coverage   67.50%   67.52%   +0.02%     
==========================================
  Files          46       46              
  Lines        4871     4875       +4     
==========================================
+ Hits         3288     3292       +4     
  Misses       1171     1171              
  Partials      412      412              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jooola jooola merged commit 01392cc into main Oct 31, 2024
5 checks passed
@jooola jooola deleted the mock-expected-more-calls branch October 31, 2024 12:23
jooola pushed a commit that referenced this pull request Oct 31, 2024
🤖 I have created a release *beep* *boop*
---


##
[2.15.0](v2.14.0...v2.15.0)
(2024-10-31)


### Features

* **exp:** add mockutil.Server helper
([#543](#543))
([fa1069b](fa1069b))
* **exp:** fail test when mock calls were expected but not received
([#542](#542))
([01392cc](01392cc))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
apricote pushed a commit to hetznercloud/fleeting-plugin-hetzner that referenced this pull request Nov 1, 2024
…5.0 (hetznercloud/fleeting-plugin-hetzner!146)

This MR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [github.com/hetznercloud/hcloud-go/v2](https://github.com/hetznercloud/hcloud-go) | require | minor | `v2.14.0` -> `v2.15.0` |

---

### Release Notes

<details>
<summary>hetznercloud/hcloud-go (github.com/hetznercloud/hcloud-go/v2)</summary>

### [`v2.15.0`](https://github.com/hetznercloud/hcloud-go/releases/tag/v2.15.0)

[Compare Source](hetznercloud/hcloud-go@v2.14.0...v2.15.0)

##### Features

-   **exp:** add mockutil.Server helper ([#&#8203;543](hetznercloud/hcloud-go#543)) ([fa1069b](hetznercloud/hcloud-go@fa1069b))
-   **exp:** fail test when mock calls were expected but not received ([#&#8203;542](hetznercloud/hcloud-go#542)) ([01392cc](hetznercloud/hcloud-go@01392cc))

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever MR is behind base branch, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this MR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box

---

This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOC4xNDAuMiIsInVwZGF0ZWRJblZlciI6IjM4LjE0MC4yIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->
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