Sha256: ea5309e14a88a04e63fdebaca619bdfcf2ba2552a8274c40d0b463018daa3663

Contents?: true

Size: 682 Bytes

Versions: 19

Compression:

Stored size: 682 Bytes

Contents

import { test } from '../qunit';
import isArray from '../../lib/utils/is-array.js';

test('isArray recognizes Array objects', function (assert) {
    assert.ok(isArray([1, 2, 3]), 'array args');
    assert.ok(isArray([]), 'empty array');
    assert.ok(isArray(new Array(1, 2, 3)), 'array constructor');
});

test('isArray rejects non-Array objects', function (assert) {
    assert.ok(!isArray(), 'nothing');
    assert.ok(!isArray(undefined), 'undefined');
    assert.ok(!isArray(null), 'null');
    assert.ok(!isArray(123), 'number');
    assert.ok(!isArray('[1,2,3]'), 'string');
    assert.ok(!isArray(new Date()), 'date');
    assert.ok(!isArray({ a: 1, b: 2 }), 'object');
});

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
card-mod-date-0.15.6 vendor/moment/src/test/moment/is_array.js
card-mod-date-0.15.0 vendor/moment/src/test/moment/is_array.js
card-mod-date-0.14.2 vendor/moment/src/test/moment/is_array.js
card-mod-date-0.14.1 vendor/moment/src/test/moment/is_array.js
card-mod-date-0.14.0 vendor/moment/src/test/moment/is_array.js
card-mod-date-0.13.4 vendor/moment/src/test/moment/is_array.js
card-mod-date-0.13.3 vendor/moment/src/test/moment/is_array.js
card-mod-date-0.13.2 vendor/moment/src/test/moment/is_array.js
card-mod-date-0.13.1 vendor/moment/src/test/moment/is_array.js
card-mod-date-0.13.0 vendor/moment/src/test/moment/is_array.js
card-mod-date-0.11.7 vendor/moment/src/test/moment/is_array.js
card-mod-date-0.12.0 vendor/moment/src/test/moment/is_array.js
card-mod-date-0.11.6 vendor/moment/src/test/moment/is_array.js
card-mod-date-0.11.5 vendor/moment/src/test/moment/is_array.js
card-mod-date-0.11.4 vendor/moment/src/test/moment/is_array.js
card-mod-date-0.11.3 vendor/moment/src/test/moment/is_array.js
card-mod-date-0.11.2 vendor/moment/src/test/moment/is_array.js
card-mod-date-0.11.1 vendor/moment/src/test/moment/is_array.js
card-mod-date-0.11.0 vendor/moment/src/test/moment/is_array.js