Skip to content

Commit

Permalink
Tests: Handle non-error thrown in validate function [fix]
Browse files Browse the repository at this point in the history
  • Loading branch information
overlookmotel committed Dec 23, 2023
1 parent e4a4807 commit c354cef
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions test/support/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,8 @@ function itSerializes(name, options, defaultOptions, describe, runExpectation) {
...opts, ...testOpts, isInput: false, isOutput: true, input, outputJs
});
} catch (err) {
// eslint-disable-next-line no-ex-assign
if (typeof err !== 'object' || err === null) err = new Error('Unknown error');
err.message = `Validation failed on output\n\n${err.message}`;
throw err;
}
Expand Down

0 comments on commit c354cef

Please sign in to comment.