Skip to content

Commit 9f7b466

Browse files
authored
test(credential-provider-imds): check for 'Unexpected token' of SyntaxError (#4840)
1 parent 2de5611 commit 9f7b466

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/credential-provider-imds/src/fromInstanceMetadata.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ describe("fromInstanceMetadata", () => {
181181
.mockResolvedValueOnce(".");
182182
(retry as jest.Mock).mockImplementation((fn: any) => fn());
183183

184-
await expect(fromInstanceMetadata()()).rejects.toEqual(new SyntaxError("Unexpected token . in JSON at position 0"));
184+
await expect(fromInstanceMetadata()()).rejects.toThrow("Unexpected token");
185185
expect(retry).toHaveBeenCalledTimes(2);
186186
expect(httpRequest).toHaveBeenCalledTimes(3);
187187
expect(fromImdsCredentials).not.toHaveBeenCalled();

0 commit comments

Comments
 (0)