Skip to content

Commit

Permalink
Fix CI failure caused by #1394 (#1406)
Browse files Browse the repository at this point in the history
  • Loading branch information
ilyasakin committed Feb 18, 2023
1 parent e371afd commit f457b09
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion __tests__/server/validate-data.js
Expand Up @@ -7,7 +7,7 @@ describe('validateData', () => {
})

test('should throw an error if data is an array', () => {
assert.throws(() => validateData([]), /Data must be an object. Found array./)
assert.throws(() => validateData([]), /Data must be an object. Found array/)
})

test("shouldn't throw an error", () => {
Expand Down
6 changes: 4 additions & 2 deletions src/server/router/validate-data.js
Expand Up @@ -17,8 +17,10 @@ module.exports = (obj) => {
Object.keys(obj).forEach(validateKey)
} else {
throw new Error(
`Data must be an object. Found ${Array.isArray(obj) ? 'array' : typeof obj}.` +
'See https://github.com/typicode/json-server for example.'
`Data must be an object. Found ${
Array.isArray(obj) ? 'array' : typeof obj
}
'See https://github.com/typicode/json-server for example.`
)
}
}

0 comments on commit f457b09

Please sign in to comment.