Sha256: f653aa3deed22c66b8093c20245ab0e7bed178d612ed6a697651f5b901a6c1dc

Contents?: true

Size: 682 Bytes

Versions: 27

Compression:

Stored size: 682 Bytes

Contents

import { module, 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

27 entries across 27 versions & 1 rubygems

Version Path
card-1.100.0 mod/date/vendor/moment/src/test/moment/is_array.js
card-1.99.6 mod/date/vendor/moment/src/test/moment/is_array.js
card-1.99.5 mod/date/vendor/moment/src/test/moment/is_array.js
card-1.99.4 mod/date/vendor/moment/src/test/moment/is_array.js
card-1.99.3 mod/date/vendor/moment/src/test/moment/is_array.js
card-1.99.2 mod/date/vendor/moment/src/test/moment/is_array.js
card-1.99.1 mod/date/vendor/moment/src/test/moment/is_array.js
card-1.99.0 mod/date/vendor/moment/src/test/moment/is_array.js
card-1.98.3 mod/date/vendor/moment/src/test/moment/is_array.js
card-1.98.2 mod/date/vendor/moment/src/test/moment/is_array.js
card-1.98.1 mod/date/vendor/moment/src/test/moment/is_array.js
card-1.98.0 mod/date/vendor/moment/src/test/moment/is_array.js
card-1.97.0.1 mod/date/vendor/moment/src/test/moment/is_array.js
card-1.97.0 mod/date/vendor/moment/src/test/moment/is_array.js
card-1.96.8 mod/date/vendor/moment/src/test/moment/is_array.js
card-1.96.7 mod/date/vendor/moment/src/test/moment/is_array.js
card-1.96.6 mod/date/vendor/moment/src/test/moment/is_array.js
card-1.96.5 mod/date/vendor/moment/src/test/moment/is_array.js
card-1.96.4 mod/date/vendor/moment/src/test/moment/is_array.js
card-1.96.3 mod/date/vendor/moment/src/test/moment/is_array.js