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

Implement registerCompletionHandler() #3283

Merged
merged 2 commits into from Jan 11, 2024
Merged

Implement registerCompletionHandler() #3283

merged 2 commits into from Jan 11, 2024

Conversation

novemberborn
Copy link
Member

@novemberborn novemberborn commented Dec 30, 2023

Register a function to be called when AVA has completed a test run without uncaught exceptions or unhandled rejections.

Fixes #3279.

…test worker

It prints the error, so it should fail as such.
Register a function to be called when AVA has completed a test run without uncaught exceptions or unhandled rejections.

Fixes #3279.
 *
 * Completion handlers are invoked in order of registration. Results are not awaited.
@novemberborn novemberborn merged commit 0a05024 into main Jan 11, 2024
16 checks passed
@novemberborn novemberborn deleted the completion branch January 11, 2024 22:33
@acro5piano
Copy link

This is fantastic for users who have been using AVA before 6.0.0. I'm looking forward to the new version. Thanks!

kodiakhq bot pushed a commit to cloudquery/plugin-sdk-javascript that referenced this pull request Feb 1, 2024
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [ava](https://avajs.dev) ([source](https://togithub.com/avajs/ava)) | devDependencies | minor | [`6.0.1` -> `6.1.1`](https://renovatebot.com/diffs/npm/ava/6.0.1/6.1.1) |

---

### Release Notes

<details>
<summary>avajs/ava (ava)</summary>

### [`v6.1.1`](https://togithub.com/avajs/ava/releases/tag/v6.1.1)

[Compare Source](https://togithub.com/avajs/ava/compare/v6.1.0...v6.1.1)

#### What's Changed

-   Fix 'previous failures' in watch mode always incrementing by [@&#8203;novemberborn](https://togithub.com/novemberborn) in [avajs/ava#3297

**Full Changelog**: avajs/ava@v6.1.0...v6.1.1

### [`v6.1.0`](https://togithub.com/avajs/ava/releases/tag/v6.1.0)

[Compare Source](https://togithub.com/avajs/ava/compare/v6.0.1...v6.1.0)

#### What's Changed

-   Implement `registerCompletionHandler()` by [@&#8203;novemberborn](https://togithub.com/novemberborn) in [avajs/ava#3283

    AVA 6 expects test code to clean up gracefully when the tests are complete, allowing the test environment (worker thread or child process) to exit. If this does not happen, AVA will report a timeout. You can use `registerCompletionHandler()` to perform any other clean up (or indeed exit the process) after AVA has completed the test execution. See [the description here](https://togithub.com/avajs/ava/blob/main/docs/08-common-pitfalls.md#timeouts-because-a-file-failed-to-exit).
-   Fix potential bug with watch mode when no failed test files are written by [@&#8203;novemberborn](https://togithub.com/novemberborn) in [avajs/ava#3287
-   Fix `ava/internal` ESM type module by [@&#8203;codetheweb](https://togithub.com/codetheweb) in [avajs/ava#3292

**Full Changelog**: avajs/ava@v6.0.1...v6.1.0

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "before 4am on the first day of the month" (UTC), Automerge - At any time (no schedule defined).

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

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

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

---

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

---

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

config to control handling for tests that 'Failed to exit' - v6+ issue
2 participants