Add a failing test.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { expect, test, beforeEach } from '@jest/globals'
|
||||
import { readConfig } from '../src/config'
|
||||
import { getRefs } from '../src/git-refs'
|
||||
import {expect, test, beforeEach} from '@jest/globals'
|
||||
import {readConfig} from '../src/config'
|
||||
import {getRefs} from '../src/git-refs'
|
||||
import * as Utils from '../src/utils'
|
||||
|
||||
// GitHub Action inputs come in the form of environment variables
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { expect, test, beforeEach } from '@jest/globals'
|
||||
import { readConfig } from '../src/config'
|
||||
import {expect, test, beforeEach} from '@jest/globals'
|
||||
import {readConfig} from '../src/config'
|
||||
import * as Utils from '../src/utils'
|
||||
|
||||
// GitHub Action inputs come in the form of environment variables
|
||||
@@ -102,3 +102,23 @@ test('it supports comma-separated lists', async () => {
|
||||
|
||||
expect(config.allow_licenses).toEqual(['MIT', 'GPL-2.0-only'])
|
||||
})
|
||||
|
||||
test('it reads a config file hosted in another repo', async () => {
|
||||
setInput(
|
||||
'config-file',
|
||||
'future-funk/anyone-cualkiera/external-config.yml@main'
|
||||
)
|
||||
setInput('external-repo-token', 'gh_viptoken')
|
||||
|
||||
setInput(
|
||||
'config-file',
|
||||
'future-funk/anyone-cualkiera/external-config.yml@main'
|
||||
)
|
||||
|
||||
setInput('external-repo-token', 'gh_viptoken')
|
||||
|
||||
const config = await Config.readConfig()
|
||||
|
||||
expect(config.fail_on_severity).toEqual('critical')
|
||||
expect(config.allow_licenses).toEqual(['BSD', 'GPL 2'])
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user