Improve error message for empty array
When `jest-codemods` was run, it replaced the error message `array.join` by a comment for the error message. Since Jest does not support custom error messages out-of-the-box, this will instead do an equality check with an empty array, which will ensure that the received array is printed.
This commit is contained in:
@@ -645,8 +645,7 @@ describe("SARIF processing", () => {
|
||||
|
||||
function expectNoParsingError(result: { errors: string[] }) {
|
||||
const array = result.errors;
|
||||
// array.join()
|
||||
expect(array.length).toBe(0);
|
||||
expect(array).toEqual([]);
|
||||
}
|
||||
|
||||
function buildValidSarifLog(): sarif.Log {
|
||||
|
||||
Reference in New Issue
Block a user