Skip to content

Commit 66219b5

Browse files
committed
changed the workflows
1 parent b2bc122 commit 66219b5

File tree

4 files changed

+88
-1
lines changed

4 files changed

+88
-1
lines changed

.github/workflows/release.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,15 @@ jobs:
4040
with:
4141
app-id: ${{ secrets.APP_ID }}
4242
kms-key-id: ${{ secrets.KMS_KEY_ID }}
43+
- uses: octokit/[email protected]
44+
id: get-repository
45+
env:
46+
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
47+
with:
48+
route: GET /installation/repositories
49+
- run: echo '${{ steps.get-repository.outputs.data }}'
4350
# install release dependencies and release
4451
- run: npm install --no-save @semantic-release/git semantic-release-plugin-github-breaking-version-tag
4552
- run: npx semantic-release --debug
4653
env:
47-
GH_TOKEN: ${{ steps.app-token.outputs.token }}#
54+
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}#

tests/main-132-133.test.js

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import test from 'ava';
2+
import { MockAgent, setGlobalDispatcher } from 'undici';
3+
import { accessTokenResponse } from '../lib/main'; // Adjust the import based on your actual function
4+
5+
test.beforeEach(() => {
6+
const agent = new MockAgent();
7+
agent.disableNetConnect();
8+
setGlobalDispatcher(agent);
9+
});
10+
11+
test('accessTokenResponse should handle the response correctly', async t => {
12+
const agent = new MockAgent();
13+
const mockPool = agent.get('https://api.github.com');
14+
15+
mockPool.intercept({
16+
path: `/app/installations/${installationId}/access_tokens`, // Adjust the path based on your actual endpoint
17+
method: 'POST',
18+
headers: {
19+
authorization: `bearer ${jwt}`
20+
}
21+
22+
}).reply(200, { /* mock response data */ });
23+
24+
setGlobalDispatcher(agent);
25+
26+
const result = await accessTokenResponse(); // Call the function you're testing
27+
28+
// t.deepEqual(result, { /* expected result */ }); // Adjust based on expected result
29+
});

tests/main-161-162.test.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// import test from 'ava';
2+
// import { MockAgent, setGlobalDispatcher } from 'undici';
3+
// import { accessTokenResponse } from '../lib/main'; // Adjust the import based on your actual function
4+
//
5+
// test.beforeEach(() => {
6+
// const agent = new MockAgent();
7+
// agent.disableNetConnect();
8+
// setGlobalDispatcher(agent);
9+
// });
10+
//
11+
// test('accessTokenResponse should handle the response correctly', async t => {
12+
// const agent = new MockAgent();
13+
// const mockPool = agent.get('https://api.github.com');
14+
//
15+
// mockPool.intercept({
16+
// path: '/your-endpoint', // Adjust the path based on your actual endpoint
17+
// method: 'GET',
18+
// }).reply(200, { /* mock response data */ });
19+
//
20+
// setGlobalDispatcher(agent);
21+
//
22+
// const result = await accessTokenResponse(); // Call the function you're testing
23+
//
24+
// t.deepEqual(result, { /* expected result */ }); // Adjust based on expected result
25+
// });

tests/main-208-210.test.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
// import test from 'ava';
2+
// import { MockAgent, setGlobalDispatcher } from 'undici';
3+
// import { createJWT } from '../lib/main'; // Adjust the import based on your actual function
4+
//
5+
// test.beforeEach(() => {
6+
// const agent = new MockAgent();
7+
// agent.disableNetConnect();
8+
// setGlobalDispatcher(agent);
9+
// });
10+
//
11+
// test('createJWT should handle the response correctly', async t => {
12+
// const agent = new MockAgent();
13+
// const mockPool = agent.get('https://api.github.com');
14+
//
15+
// mockPool.intercept({
16+
// path: '/your-endpoint', // Adjust the path based on your actual endpoint
17+
// method: 'GET',
18+
// }).reply(200, { /* mock response data */ });
19+
//
20+
// setGlobalDispatcher(agent);
21+
//
22+
// const result = await createJWT(); // Call the function you're testing
23+
//
24+
// t.deepEqual(result, { /* expected result */ }); // Adjust based on expected result
25+
// });
26+
//

0 commit comments

Comments
 (0)