mirror of
https://github.com/typicode/json-server.git
synced 2025-07-28 12:43:18 +08:00
Add prettier
This commit is contained in:
@ -3,22 +3,14 @@ const validateData = require('../../src/server/router/validate-data')
|
||||
|
||||
describe('validateData', () => {
|
||||
it('should throw an error if data contains /', () => {
|
||||
assert.throws(
|
||||
() => validateData({ 'a/b': [] }),
|
||||
/found \//
|
||||
)
|
||||
assert.throws(() => validateData({ 'a/b': [] }), /found \//)
|
||||
})
|
||||
|
||||
it('should throw an error if data is an array', () => {
|
||||
assert.throws(
|
||||
() => validateData([]),
|
||||
/must be an object/
|
||||
)
|
||||
assert.throws(() => validateData([]), /must be an object/)
|
||||
})
|
||||
|
||||
it('shouldn\'t throw an error', () => {
|
||||
assert.doesNotThrow(
|
||||
() => validateData({ a: [] })
|
||||
)
|
||||
it("shouldn't throw an error", () => {
|
||||
assert.doesNotThrow(() => validateData({ a: [] }))
|
||||
})
|
||||
})
|
||||
|
Reference in New Issue
Block a user