Add a failing test.

This commit is contained in:
Federico Builes
2023-04-06 16:21:52 +02:00
parent 97c9465751
commit 0041d7fa41
2 changed files with 25 additions and 5 deletions

View File

@@ -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

View File

@@ -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'])
})