Use let instead of var, fix failing test.
This commit is contained in:
@@ -2,7 +2,7 @@ import { expect, test } from '@jest/globals'
|
||||
import { readConfigFile } from '../src/config'
|
||||
|
||||
test('reads the config file', async () => {
|
||||
var options = readConfigFile("./__tests__/fixtures/config-allow-sample.yml")
|
||||
let options = readConfigFile("./__tests__/fixtures/config-allow-sample.yml")
|
||||
expect(options.fail_on_severity).toEqual('critical')
|
||||
expect(options.allow_licenses).toEqual(['BSD', 'GPL 2'])
|
||||
})
|
||||
@@ -16,7 +16,7 @@ test('the default config path handles .yml and .yaml', async () => {
|
||||
})
|
||||
|
||||
test('returns a default config when the config file was not found', async () => {
|
||||
var options = readConfigFile("fixtures/i-dont-exist")
|
||||
expect(options.fail_on_severity).toEqual('all')
|
||||
let options = readConfigFile("fixtures/i-dont-exist")
|
||||
expect(options.fail_on_severity).toEqual('low')
|
||||
expect(options.allow_licenses).toEqual(['all'])
|
||||
})
|
||||
})
|
||||
|
||||
@@ -47,8 +47,8 @@ let rubyChange: Change = {
|
||||
}
|
||||
|
||||
test('it properly filters changes by severity', async () => {
|
||||
let changes: Changes = [npmChange, rubyChange]
|
||||
const expectedChanges: Changes = [npmChange]
|
||||
let changes = [npmChange, rubyChange]
|
||||
const expectedChanges = [npmChange]
|
||||
changes = filterChangesBySeverity('high', changes)
|
||||
expect(changes).toEqual(expectedChanges)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user