11import fs from 'fs' ;
22import nock from 'nock' ;
3+ import { OctokitOptions } from '@octokit/core/dist-types/types' ;
34import { Inputs } from '../src/context' ;
45import { Labeler , LabelStatus } from '../src/labeler' ;
56
@@ -74,6 +75,11 @@ const cases = [
7475
7576const orginalGitHubRepo = process . env . GITHUB_REPOSITORY ;
7677
78+ const octokitOptions = {
79+ retry : { enabled : false } ,
80+ throttle : { enabled : false }
81+ } as OctokitOptions ;
82+
7783describe ( 'run' , ( ) => {
7884 beforeAll ( ( ) => {
7985 process . env . GITHUB_REPOSITORY = 'crazy-max/ghaction-github-labeler' ;
@@ -95,7 +101,7 @@ describe('run', () => {
95101 . get ( `/repos/crazy-max/ghaction-github-labeler/contents/${ encodeURIComponent ( input . yamlFile as string ) } ` )
96102 . reply ( 200 , configFixture ( input . yamlFile as string ) ) ;
97103
98- const labeler = new Labeler ( input ) ;
104+ const labeler = new Labeler ( input , octokitOptions ) ;
99105 await labeler . printRepoLabels ( ) ;
100106 console . log (
101107 ( await labeler . labels ) . map ( label => {
@@ -166,7 +172,7 @@ describe('run', () => {
166172 . get ( `/repos/crazy-max/ghaction-github-labeler/contents/${ encodeURIComponent ( '.res/labels.merge1.yml' ) } ` )
167173 . reply ( 200 , configFixture ( '.res/labels.merge1.yml' ) ) ;
168174
169- const labeler = new Labeler ( input ) ;
175+ const labeler = new Labeler ( input , octokitOptions ) ;
170176 const fileLabels = await labeler . fileLabels ;
171177 expect ( fileLabels . length ) . toBe ( 16 ) ;
172178 expect ( fileLabels [ 15 ] ) . toEqual ( expect . objectContaining ( { name : ':unicorn: Special' } ) ) ;
0 commit comments