mirror of
https://github.com/typicode/json-server.git
synced 2025-07-27 20:23:34 +08:00
Remove automatic type conversion
This commit is contained in:
@ -4,24 +4,6 @@ var utils = require('../../src/server/utils')
|
||||
/* global describe, it */
|
||||
|
||||
describe('utils', function () {
|
||||
describe('toNative', function () {
|
||||
it('should convert string to native type', function () {
|
||||
// should convert
|
||||
assert.strictEqual(utils.toNative('1'), 1)
|
||||
assert.strictEqual(utils.toNative('0'), 0)
|
||||
assert.strictEqual(utils.toNative('true'), true)
|
||||
// should not convert
|
||||
assert.strictEqual(utils.toNative(''), '')
|
||||
assert.strictEqual(utils.toNative('\t\n'), '\t\n')
|
||||
assert.strictEqual(utils.toNative('1 '), '1 ')
|
||||
assert.strictEqual(utils.toNative('01'), '01')
|
||||
assert.strictEqual(utils.toNative(' 1'), ' 1')
|
||||
assert.strictEqual(utils.toNative('string'), 'string')
|
||||
assert.strictEqual(utils.toNative(1), 1)
|
||||
assert.strictEqual(utils.toNative(true), true)
|
||||
})
|
||||
})
|
||||
|
||||
describe('getPage', function () {
|
||||
var array = [1, 2, 3, 4, 5]
|
||||
var perPage = 2
|
||||
|
Reference in New Issue
Block a user