Skip to content

Commit 2f89967

Browse files
committed
Add pause
1 parent 3d91fc4 commit 2f89967

File tree

5 files changed

+13
-2
lines changed

5 files changed

+13
-2
lines changed

__tests__/actions.test.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import * as github from '../__fixtures__/github.js'
44
import * as octokit from '../__fixtures__/octokit.js'
55
import { AllowedIssueAction } from '../src/enums.js'
66

7+
jest.useFakeTimers()
78
jest.unstable_mockModule('@actions/core', () => core)
89
jest.unstable_mockModule('@actions/github', () => github)
910
jest.unstable_mockModule('@octokit/rest', async () => {
@@ -142,6 +143,8 @@ describe('actions', () => {
142143
},
143144
{ issue: { number: 1 } } as any
144145
)
146+
147+
jest.runAllTimers()
145148
} catch (error: any) {
146149
// eslint-disable-next-line jest/no-conditional-expect
147150
expect(error.message).toBe('Team Already Exists: gh-int-na1')

badges/coverage.svg

Lines changed: 1 addition & 1 deletion
Loading

dist/index.js

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

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/actions.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,11 @@ export async function create(
3737
// Create and configure the user repositories.
3838
for (const user of request.attendees) {
3939
const repo = await repos.create(request, user, team)
40+
41+
// Sleep 5s to wait for the repo to be created and initial commit pushed.
42+
if (process.env.NODE_ENV !== 'test')
43+
await new Promise((resolve) => setTimeout(resolve, 5000))
44+
4045
await repos.configure(request, user, repo, team)
4146
}
4247

0 commit comments

Comments
 (0)