File tree Expand file tree Collapse file tree 4 files changed +88
-1
lines changed
Expand file tree Collapse file tree 4 files changed +88
-1
lines changed Original file line number Diff line number Diff line change 4040 with :
4141 app-id : ${{ secrets.APP_ID }}
4242 kms-key-id : ${{ secrets.KMS_KEY_ID }}
43+ - uses : octokit/request-action@v2.x
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 }}#
Original file line number Diff line number Diff line change 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+ } ) ;
Original file line number Diff line number Diff line change 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+ // });
Original file line number Diff line number Diff line change 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+ //
You can’t perform that action at this time.
0 commit comments