Commit e92e44f2 authored by Ronan Abhamon's avatar Ronan Abhamon

feat(Utils): add tests for `isArray`

parent 735bd32b
......@@ -33,21 +33,6 @@ TestCase {
// -----------------------------------------------------------------
function test_snakeToCamel_data () {
return [
{ input: 'foo_bar', output: 'fooBar' },
{ input: 'george_abitbol', output: 'georgeAbitbol' },
{ input: 'billTremendousAndHubert', output: 'billTremendousAndHubert' },
{ input: 'foo_bAr_BAZ', output: 'fooBArBAZ' }
]
}
function test_snakeToCamel (data) {
compare(Utils.snakeToCamel(data.input), data.output)
}
// -----------------------------------------------------------------
function test_setTimeoutWithoutParent () {
try {
Utils.setTimeout(null, 0, function () {
......@@ -138,24 +123,6 @@ TestCase {
// -----------------------------------------------------------------
function test_isString_data () {
return [
{ input: 'foo', output: true },
{ input: Object('bar'), output: true },
{ input: [ 0 ], output: false },
{ input: /baz/, output: false },
{ input: new Error, output: false },
{ input: true, output: false },
{ input: 42, output: false }
]
}
function test_isString (data) {
compare(Utils.isString(data.input), data.output)
}
// -----------------------------------------------------------------
function test_genRandomNumber_data () {
return [
{ min: 42, max: 3600 },
......@@ -212,6 +179,58 @@ TestCase {
})
}
// -----------------------------------------------------------------
function test_isArray_data () {
return [
{ input: [], output: true },
{ input: {}, output: false },
{ input: [ 6 ], output: true },
{ input: /bar/, output: false },
{ input: new Error, output: false },
{ input: true, output: false },
{ input: 42, output: false },
{ input: new Array(), output: true }
]
}
function test_isArray (data) {
compare(Utils.isArray(data.input), data.output)
}
// -----------------------------------------------------------------
function test_isString_data () {
return [
{ input: 'foo', output: true },
{ input: Object('bar'), output: true },
{ input: [ 0 ], output: false },
{ input: /baz/, output: false },
{ input: new Error, output: false },
{ input: true, output: false },
{ input: 42, output: false }
]
}
function test_isString (data) {
compare(Utils.isString(data.input), data.output)
}
// -----------------------------------------------------------------
function test_snakeToCamel_data () {
return [
{ input: 'foo_bar', output: 'fooBar' },
{ input: 'george_abitbol', output: 'georgeAbitbol' },
{ input: 'billTremendousAndHubert', output: 'billTremendousAndHubert' },
{ input: 'foo_bAr_BAZ', output: 'fooBArBAZ' }
]
}
function test_snakeToCamel (data) {
compare(Utils.snakeToCamel(data.input), data.output)
}
// -----------------------------------------------------------------
function test_startsWith_data () {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment