Sha256: ae65710c2cf52b27e3a8fb1c9fd2ac470cba98eed473913a09c9e5b187893fdf
Contents?: true
Size: 753 Bytes
Versions: 3
Compression:
Stored size: 753 Bytes
Contents
import { AbstractTestCase } from 'internal-test-helpers'; import { runArrayTests, newFixture } from '../helpers/array'; class IndexOfTests extends AbstractTestCase { '@test should return index of object'() { let expected = newFixture(3); let obj = this.newObject(expected); let len = 3; for (let idx = 0; idx < len; idx++) { this.assert.equal( obj.indexOf(expected[idx]), idx, `obj.indexOf(${expected[idx]}) should match idx` ); } } '@test should return -1 when requesting object not in index'() { let obj = this.newObject(newFixture(3)); let foo = {}; this.assert.equal(obj.indexOf(foo), -1, 'obj.indexOf(foo) should be < 0'); } } runArrayTests('indexOf', IndexOfTests);
Version data entries
3 entries across 3 versions & 1 rubygems