Skip to content

Commit e34ff90

Browse files
committed
fix test
1 parent fe1a0a5 commit e34ff90

2 files changed

Lines changed: 10 additions & 7 deletions

File tree

__tests__/labeler.test.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,24 +72,27 @@ const cases = [
7272
]
7373
];
7474

75+
const orginalGitHubRepo = process.env.GITHUB_REPOSITORY
76+
7577
describe('run', () => {
7678
beforeAll(() => {
79+
process.env.GITHUB_REPOSITORY = 'crazy-max/ghaction-github-labeler';
7780
nock.disableNetConnect();
7881
// nock.recorder.rec();
7982
});
8083
afterAll(() => {
84+
process.env.GITHUB_REPOSITORY = orginalGitHubRepo;
8185
// nock.restore()
8286
nock.cleanAll();
8387
nock.enableNetConnect();
8488
});
8589
test.each(cases)('given %p', async (name, inputs, expected) => {
86-
process.env.GITHUB_REPOSITORY = 'crazy-max/ghaction-github-labeler';
8790
const input = inputs as Inputs;
8891

8992
nock('https://api.github.com').get('/repos/crazy-max/ghaction-github-labeler/labels').reply(200, labelsFixture());
9093

9194
nock('https://api.github.com')
92-
.get(`/repos/jetersen/ghaction-github-labeler/contents/${encodeURIComponent(input.yamlFile as string)}`)
95+
.get(`/repos/crazy-max/ghaction-github-labeler/contents/${encodeURIComponent(input.yamlFile as string)}`)
9396
.reply(200, configFixture(input.yamlFile as string));
9497

9598
const labeler = new Labeler(input);
@@ -146,7 +149,6 @@ describe('run', () => {
146149
expect(() => labeler.run()).not.toThrow();
147150
});
148151
it('merge', async () => {
149-
process.env.GITHUB_REPOSITORY = 'crazy-max/ghaction-github-labeler';
150152
const input = <Inputs>{
151153
githubToken: process.env.GITHUB_TOKEN || 'test',
152154
yamlFile: '.res/labels.merge2.yml',

dist/index.js

Lines changed: 5 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)