-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(dependencies): bumped to the alpha of the github scaffolder
to get the initial support for github repo creation for travi/github-scaffolder#1
- Loading branch information
Showing
3 changed files
with
52 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 25 additions & 8 deletions
33
test/integration/features/step_definitions/common-steps.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
test/integration/features/step_definitions/vcs/github-api-steps.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import {After, Before, Given} from 'cucumber'; | ||
import any from '@travi/any'; | ||
import nock from 'nock'; | ||
import {OK} from 'http-status-codes'; | ||
|
||
let githubScope; | ||
export const githubToken = any.string(); | ||
const debug = require('debug')('test'); | ||
|
||
Before(async () => { | ||
nock.disableNetConnect(); | ||
|
||
githubScope = nock('https://api.github.com/').log(debug); | ||
}); | ||
|
||
After(() => { | ||
nock.enableNetConnect(); | ||
nock.cleanAll(); | ||
}); | ||
|
||
Given('the GitHub token is valid', async function () { | ||
githubScope | ||
.matchHeader('Authorization', `token ${githubToken}`) | ||
.post('/user/repos') | ||
.reply(OK); | ||
}); |