Fix some errors not showing up in GitHub annotations (#8799)

* Remove dead code now that `expect()` can be used outside of tests

* Fix some errors not being rendered to GitHub annotations

* [autofix.ci] apply automated fixes

* Update jest.zig

Try `execCallback`

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
This commit is contained in:
Ashcon Partovi
2024-02-08 17:52:58 -08:00
committed by GitHub
parent db85e04ade
commit 1ccf0c2e9c
4 changed files with 188 additions and 209 deletions

View File

@@ -1025,8 +1025,7 @@ pub const TestCommand = struct {
switch (promise.status(vm.global.vm())) {
.Rejected => {
const result = promise.result(vm.global.vm());
vm.runErrorHandler(result, null);
vm.onUnhandledError(vm.global, promise.result(vm.global.vm()));
reporter.summary.fail += 1;
if (reporter.jest.bail == reporter.summary.fail) {
@@ -1110,8 +1109,8 @@ pub const TestCommand = struct {
if (is_last) {
if (jest.Jest.runner != null) {
if (jest.DescribeScope.runGlobalCallbacks(vm.global, .afterAll)) |after| {
vm.global.bunVM().runErrorHandler(after, null);
if (jest.DescribeScope.runGlobalCallbacks(vm.global, .afterAll)) |err| {
vm.onUnhandledError(vm.global, err);
}
}
}