Skip to content
This repository has been archived by the owner on Jan 10, 2025. It is now read-only.

Commit

Permalink
chore: Ensure mockes are always loaded so tests can run in isolation …
Browse files Browse the repository at this point in the history
…(#1454)

* Ensure mockes are always loaded so tests can run in isolation

* please the linter

* Add CI check two test 2 tests of both suites in isolation

* Add CI check two test 2 tests of both suites in isolation

* Add CI check two test 2 tests of both suites in isolation
  • Loading branch information
npalm authored Dec 1, 2021
1 parent 5b68b7b commit e8166b9
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 18 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/lambda-runners.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,9 @@ jobs:
run: yarn lint
- name: Run tests
run: yarn test
- name: Run two tests in isolation
run: |
yarn run test src/scale-runners/scale-up.test.ts -t 'scaleUp with GHES on org level creates a runner with labels in s specific group' --coverage=false
yarn run test src/scale-runners/scale-up.test.ts -t 'scaleUp with public GH on org level creates a runner with labels in s specific group' --coverage=false
- name: Build distribution
run: yarn build
36 changes: 18 additions & 18 deletions modules/runners/lambdas/runners/src/scale-runners/scale-up.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,28 +112,28 @@ beforeEach(() => {
owner: TEST_DATA.repositoryOwner,
},
]);

mockedAppAuth.mockResolvedValue({
type: 'app',
token: 'token',
appId: TEST_DATA.installationId,
expiresAt: 'some-date',
});
mockedInstallationAuth.mockResolvedValue({
type: 'token',
tokenType: 'installation',
token: 'token',
createdAt: 'some-date',
expiresAt: 'some-date',
permissions: {},
repositorySelection: 'all',
});

mockCreateClient.mockResolvedValue(new mocktokit());
});

describe('scaleUp with GHES', () => {
beforeEach(() => {
mockedAppAuth.mockResolvedValue({
type: 'app',
token: 'token',
appId: TEST_DATA.installationId,
expiresAt: 'some-date',
});
mockedInstallationAuth.mockResolvedValue({
type: 'token',
tokenType: 'installation',
token: 'token',
createdAt: 'some-date',
expiresAt: 'some-date',
permissions: {},
repositorySelection: 'all',
});

mockCreateClient.mockResolvedValue(new mocktokit());

process.env.GHES_URL = 'https://github.enterprise.something';
});

Expand Down

0 comments on commit e8166b9

Please sign in to comment.