mirror of
https://github.com/MillironX/setup-nextflow.git
synced 2024-11-21 17:36:04 +00:00
test: Add initial check for all_nf_releases
This commit is contained in:
parent
40343dfa61
commit
6cafaa8e2c
1 changed files with 30 additions and 2 deletions
|
@ -1,7 +1,35 @@
|
||||||
import test from 'ava'
|
import * as functions from '../src/functions'
|
||||||
|
import * as github from '@actions/github'
|
||||||
|
import anyTest, {TestFn} from 'ava'
|
||||||
|
|
||||||
|
const test = anyTest as TestFn<{foo: string}>
|
||||||
|
|
||||||
|
test.before(t => {
|
||||||
|
const first = true
|
||||||
|
const current_token = getToken(first)
|
||||||
|
t.context = {token: current_token}
|
||||||
|
t.context = {octokit: github.getOctokit(current_token)}
|
||||||
|
})
|
||||||
|
|
||||||
|
test('all_nf_releases', async t => {
|
||||||
|
const result = await functions.all_nf_releases(t.context.octokit)
|
||||||
|
t.is(typeof result, 'object')
|
||||||
|
})
|
||||||
|
|
||||||
test.todo('all_nf_releases')
|
|
||||||
test.todo('lastest_stable_release_data')
|
test.todo('lastest_stable_release_data')
|
||||||
test.todo('release_data')
|
test.todo('release_data')
|
||||||
test.todo('nextflow_bin_url')
|
test.todo('nextflow_bin_url')
|
||||||
test.todo('install_nextflow')
|
test.todo('install_nextflow')
|
||||||
|
|
||||||
|
function getToken(first: boolean): string {
|
||||||
|
const token = process.env['GITHUB_TOKEN'] || ''
|
||||||
|
if (!token && first) {
|
||||||
|
/* eslint-disable-next-line no-console */
|
||||||
|
console.warn(
|
||||||
|
'Skipping GitHub tests. Set $GITHUB_TOKEN to run REST client and GraphQL client tests'
|
||||||
|
)
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
|
||||||
|
return token
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue