From 0c8a4aada9ff87de9ff0c0ff8881a4509d65bbbd Mon Sep 17 00:00:00 2001 From: Tushar Pandey Date: Tue, 8 Oct 2024 14:32:54 +0530 Subject: [PATCH 1/3] changed README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a9ad48cd6..be599798e 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ This library supports the following tooling versions: ### Installation -Using [npm](https://npmjs.org) in your project directory run the following command: +Using [npm](https://npmjs.org) in your project directory, run the following command: ```bash npm install auth0 From 9d150605d11de333612475398cdec35920daf837 Mon Sep 17 00:00:00 2001 From: Tushar Pandey Date: Tue, 8 Oct 2024 15:40:43 +0530 Subject: [PATCH 2/3] added instantiation check --- test/auth/id-token-validator.test.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/test/auth/id-token-validator.test.ts b/test/auth/id-token-validator.test.ts index 2f0a32a81..b0cc73b73 100644 --- a/test/auth/id-token-validator.test.ts +++ b/test/auth/id-token-validator.test.ts @@ -442,4 +442,15 @@ describe('id-token-validator', () => { idTokenValidator.validate(jwt, { organization: 'testOrg' }) ).resolves.not.toThrow(); }); + it('creates an instance of IdTokenValidator', async () => { + const idTokenValidator = new IDTokenValidator({ + domain: DOMAIN, + clientId: CLIENT_ID, + clientSecret: CLIENT_SECRET, + agent: {} as any, // Stub for the agent parameter, + headers: {} as any, // Stub for the headers parameter, + timeoutDuration: 5000, + }); + expect(idTokenValidator).toBeInstanceOf(IDTokenValidator); + }); }); From c2baa7b36cd9309deff4aa85112c5c1cbd2eb440 Mon Sep 17 00:00:00 2001 From: Tushar Pandey Date: Tue, 8 Oct 2024 16:45:38 +0530 Subject: [PATCH 3/3] added exception check --- test/lib/runtime.test.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/lib/runtime.test.ts b/test/lib/runtime.test.ts index 495647212..0977d8517 100644 --- a/test/lib/runtime.test.ts +++ b/test/lib/runtime.test.ts @@ -837,3 +837,11 @@ describe('Runtime for UserInfoClient', () => { expect(request.isDone()).toBe(true); }); }); + +describe('test baseAPI', () => { + // following error is thrown: throw new Error('The provided base URL is invalid'); + // add expect statement for this error below + expect( + () => new BaseAPI({ baseUrl: {} as any, parseError: () => Promise.resolve(new Error('tmp')) }) + ).toThrowError('The provided base URL is invalid'); +});