forked from cypress-io/make-empty-github-commit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathspec.js
More file actions
31 lines (27 loc) · 893 Bytes
/
spec.js
File metadata and controls
31 lines (27 loc) · 893 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
'use strict'
const la = require('lazy-ass')
const is = require('check-more-types')
const makeEmptyGithubCommit = require('..')
/* eslint-env mocha */
describe('make-empty-github-commit', () => {
// to work, requires GitHub token set via an environment variable
// usually this token is set as part of semantic release setup
const token =
process.env.TOKEN || process.env.GITHUB_TOKEN || process.env.GH_TOKEN
if (token) {
it('adds empty commit', function () {
this.timeout(10000)
if (!token) {
throw new Error('Cannot find TOKEN or GITHUB_TOKEN or GH_TOKEN')
}
return makeEmptyGithubCommit({
owner: 'bahmutov',
repo: 'test-make-empty-github-commit',
message: 'this is a test',
token: token
}).then(result => {
la(is.commitId(result.sha), 'expected to find sha in', result)
})
})
}
})