Skip to content

Commit

Permalink
fix: unit test that was failing on ci due to difference in plaform js…
Browse files Browse the repository at this point in the history
…on packages
  • Loading branch information
mcknasty committed Feb 3, 2024
1 parent e05ebf6 commit bec85d7
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions test/load-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -214,9 +214,10 @@ describe(loadConfigFile.name, () => {

it('throws an error if the JSON file is invalid JSON', () => {
const configFile = 'test.json'
const expectedErrorMsg = `Error loading configuration from file "${configFile}": ` +
'must contain a valid c8 configuration object. Original error: Unexpected token ' +
"'o'" + ', "not valid json" is not valid JSON'

const errorPattern = 'Error loading configuration from file ".+": ' +
'must contain a valid c8 configuration object. Original error: .*'
const errorRegEx = new RegExp(errorPattern, 'g')

expect(() =>
loadConfigFile(configFile, {
Expand All @@ -225,7 +226,7 @@ describe(loadConfigFile.name, () => {
})
).to.throw(
ConfigParsingError,
expectedErrorMsg
errorRegEx
)
})

Expand Down

0 comments on commit bec85d7

Please sign in to comment.