Skip to content

Commit 5c45a48

Browse files
committed
test: check auth token when running mockedRequests tests
1 parent 895f1e5 commit 5c45a48

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

src/tests/mockedRequests.test.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ const TEST_ISSUE_NUM = 1;
1010
const isCI = process.env.CI === 'true';
1111
const currRepo = process.env.GITHUB_REPOSITORY || '';
1212
const ALLOWED_REPO = `${TEST_REPO.owner}/${TEST_REPO.repo}`;
13-
const shouldRunTests = isCI && currRepo === ALLOWED_REPO;
13+
const auth = process.env.MOCKED_REQUEST_TEST;
14+
const shouldRunTests = isCI && currRepo === ALLOWED_REPO && auth !== undefined;
1415

1516
describe('GitHub API Integration Tests', () => {
1617
if (!shouldRunTests) {
@@ -20,9 +21,7 @@ describe('GitHub API Integration Tests', () => {
2021
return;
2122
}
2223

23-
const octokit = new Octokit({
24-
auth: process.env.MOCKED_REQUEST_TEST,
25-
});
24+
const octokit = new Octokit({ auth });
2625

2726
describe('Issues API', () => {
2827
it('Should list repository issues with the expected structure', async () => {

0 commit comments

Comments
 (0)