Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix CI failure caused by #1394 #1406

Merged
merged 5 commits into from
Feb 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion __tests__/server/validate-data.js
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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.`
)
}
}