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:
Koen Vlaswinkel
2022-11-22 15:54:22 +01:00
parent ec60f3f000
commit f5c39d7931

View File

@@ -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 {