Skip to content

Commit

Permalink
Refactor error processing
Browse files Browse the repository at this point in the history
This commit simplifies error serialization, relying on the advanced IPC for child processes & worker threads. Unnecessary code has been removed.

Possibly breaking changes:

* Renamed and removed fields from the undocumented AssertionError class, including the raw values
* Changes to the undocumented TAP output; stack traces are a bit worse, the rest is about the same but some fields have different names or values
* `nyc` stack frames are no longer ignored; we assume you're using the native code coverage tools
  • Loading branch information
novemberborn committed Sep 4, 2023
1 parent e27183a commit 4363619
Show file tree
Hide file tree
Showing 45 changed files with 958 additions and 1,170 deletions.
8 changes: 1 addition & 7 deletions lib/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -305,13 +305,7 @@ export default class Api extends Emittery {
const files = scheduler.storeFailedTestFiles(runStatus, this.options.cacheEnabled === false ? null : this._createCacheDir());
runStatus.emitStateChange({type: 'touched-files', files});
} catch (error) {
if (error?.name === 'AggregateError') {
for (const error_ of error.errors) {
runStatus.emitStateChange({type: 'internal-error', err: serializeError('Internal error', false, error_)});
}
} else {
runStatus.emitStateChange({type: 'internal-error', err: serializeError('Internal error', false, error)});
}
runStatus.emitStateChange({type: 'internal-error', err: serializeError(error)});
}

timeoutTrigger.discard();
Expand Down
Loading

0 comments on commit 4363619

Please sign in to comment.