diff --git a/tests/main-132-133.test.js b/tests/main-132-133.test.js deleted file mode 100644 index 0baceef..0000000 --- a/tests/main-132-133.test.js +++ /dev/null @@ -1,29 +0,0 @@ -import test from 'ava'; -import { MockAgent, setGlobalDispatcher } from 'undici'; -import { accessTokenResponse } from '../lib/main'; // Adjust the import based on your actual function - -test.beforeEach(() => { - const agent = new MockAgent(); - agent.disableNetConnect(); - setGlobalDispatcher(agent); -}); - -test('accessTokenResponse should handle the response correctly', async t => { - const agent = new MockAgent(); - const mockPool = agent.get('https://api.github.com'); - - mockPool.intercept({ - path: `/app/installations/${installationId}/access_tokens`, // Adjust the path based on your actual endpoint - method: 'POST', - headers: { - authorization: `bearer ${jwt}` - } - - }).reply(200, { /* mock response data */ }); - - setGlobalDispatcher(agent); - - const result = await accessTokenResponse(); // Call the function you're testing - - // t.deepEqual(result, { /* expected result */ }); // Adjust based on expected result -}); diff --git a/tests/main-161-162.test.js b/tests/main-161-162.test.js deleted file mode 100644 index e29c43a..0000000 --- a/tests/main-161-162.test.js +++ /dev/null @@ -1,25 +0,0 @@ -// import test from 'ava'; -// import { MockAgent, setGlobalDispatcher } from 'undici'; -// import { accessTokenResponse } from '../lib/main'; // Adjust the import based on your actual function -// -// test.beforeEach(() => { - // const agent = new MockAgent(); - // agent.disableNetConnect(); - // setGlobalDispatcher(agent); -// }); -// -// test('accessTokenResponse should handle the response correctly', async t => { - // const agent = new MockAgent(); - // const mockPool = agent.get('https://api.github.com'); - // - // mockPool.intercept({ - // path: '/your-endpoint', // Adjust the path based on your actual endpoint - // method: 'GET', - // }).reply(200, { /* mock response data */ }); -// - // setGlobalDispatcher(agent); -// - // const result = await accessTokenResponse(); // Call the function you're testing -// - // t.deepEqual(result, { /* expected result */ }); // Adjust based on expected result -// }); diff --git a/tests/main-208-210.test.js b/tests/main-208-210.test.js deleted file mode 100644 index cb6d0d2..0000000 --- a/tests/main-208-210.test.js +++ /dev/null @@ -1,26 +0,0 @@ -// import test from 'ava'; -// import { MockAgent, setGlobalDispatcher } from 'undici'; -// import { createJWT } from '../lib/main'; // Adjust the import based on your actual function -// -// test.beforeEach(() => { - // const agent = new MockAgent(); - // agent.disableNetConnect(); - // setGlobalDispatcher(agent); -// }); -// -// test('createJWT should handle the response correctly', async t => { - // const agent = new MockAgent(); - // const mockPool = agent.get('https://api.github.com'); - // - // mockPool.intercept({ - // path: '/your-endpoint', // Adjust the path based on your actual endpoint - // method: 'GET', - // }).reply(200, { /* mock response data */ }); -// - // setGlobalDispatcher(agent); -// - // const result = await createJWT(); // Call the function you're testing -// - // t.deepEqual(result, { /* expected result */ }); // Adjust based on expected result -// }); -// \ No newline at end of file