Skip to content

Commit

Permalink
tests: use correct github token
Browse files Browse the repository at this point in the history
  • Loading branch information
bodinsamuel committed May 5, 2023
1 parent e025190 commit 8e4cb88
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 4 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ jobs:
timeout-minutes: 10

env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GENERATED_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}

steps:
- name: Check out repository code
Expand Down
4 changes: 4 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"vitest": "0.30.1"
},
"dependencies": {
"@octokit/plugin-retry": "^4.1.3",
"dotenv": "16.0.3",
"hcl2-parser": "1.0.3",
"nanoid": "4.0.2",
Expand Down
12 changes: 9 additions & 3 deletions src/analyser/index.github.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,24 @@ import path from 'node:path';

import * as dotenv from 'dotenv';
import { Octokit } from 'octokit';
import { describe, it, expect, vi, beforeEach } from 'vitest';
import { describe, it, expect, vi, beforeEach, beforeAll } from 'vitest';

import { FSProvider } from '../provider/fs';
import { GithubAPIProvider } from '../provider/githubApi';
import { cleanNestedSnapshot } from '../tests/helpers';

import { analyser } from '.';

dotenv.config();

let id = 0;
vi.mock('../common/nid.ts', () => {
return { nid: () => `${id++}` };
});

describe('analyser', () => {
beforeAll(() => {
dotenv.config();
});

beforeEach(() => {
vi.resetAllMocks();
});
Expand All @@ -33,6 +35,10 @@ describe('analyser', () => {
path: '/tests/__fixtures__',
octokit: new Octokit({
auth: process.env.GITHUB_TOKEN,
request: {
timeout: 1000,
retries: 0,
},
}),
owner: 'specfy',
repo: 'tech-analyser',
Expand Down

0 comments on commit 8e4cb88

Please sign in to comment.