Skip to content

Commit

Permalink
test(credential-provider-imds): check for 'Unexpected token' of Synta…
Browse files Browse the repository at this point in the history
…xError (#4840)
  • Loading branch information
trivikr committed Jun 14, 2023
1 parent 2de5611 commit 9f7b466
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ describe("fromInstanceMetadata", () => {
.mockResolvedValueOnce(".");
(retry as jest.Mock).mockImplementation((fn: any) => fn());

await expect(fromInstanceMetadata()()).rejects.toEqual(new SyntaxError("Unexpected token . in JSON at position 0"));
await expect(fromInstanceMetadata()()).rejects.toThrow("Unexpected token");
expect(retry).toHaveBeenCalledTimes(2);
expect(httpRequest).toHaveBeenCalledTimes(3);
expect(fromImdsCredentials).not.toHaveBeenCalled();
Expand Down

0 comments on commit 9f7b466

Please sign in to comment.