mirror of
https://github.com/typicode/json-server.git
synced 2025-07-28 04:32:24 +08:00
Refactor and update to LowDB 0.4
This commit is contained in:
@ -2,11 +2,11 @@ var assert = require('assert')
|
||||
var utils = require('../src/utils')
|
||||
|
||||
describe('utils', function() {
|
||||
|
||||
|
||||
describe('getRemovable', function() {
|
||||
|
||||
it('should return removable documents', function() {
|
||||
|
||||
|
||||
var db = {
|
||||
posts: [
|
||||
{id: 1, comment: 1}
|
||||
@ -20,8 +20,8 @@ describe('utils', function() {
|
||||
}
|
||||
|
||||
var expected = [
|
||||
['comments', 2],
|
||||
['comments', 3]
|
||||
{ name: 'comments', id: 2 },
|
||||
{ name: 'comments', id: 3 }
|
||||
]
|
||||
|
||||
assert.deepEqual(expected, utils.getRemovable(db))
|
||||
@ -39,7 +39,7 @@ describe('utils', function() {
|
||||
assert.strictEqual(utils.toNative('string'), 'string')
|
||||
assert.strictEqual(utils.toNative(1), 1)
|
||||
assert.strictEqual(utils.toNative(true), true)
|
||||
|
||||
|
||||
})
|
||||
|
||||
})
|
||||
|
Reference in New Issue
Block a user