Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
test('it generates unique ids', function (assert) {
assert.expect(1);
let i;
const items = [];
for (i = 0; i < 1000; i++) {
items.push({});
}
const ids = items.map(item => {
return setGuidFor(item);
});
const uniqueIds = uniq(ids);
assert.deepEqual(uniqueIds, ids, 'all ids should be unique');
});
true,
true,
true,
false,
false,
{},
dupedObject,
dupedObject
];
const ids = items.map(item => {
return setGuidFor(item);
});
const uniqueIds = uniq(ids);
const uniqueItems = uniq(items);
assert.equal(uniqueIds.length, uniqueItems.length, 'the number of unique ids matches the number of unique items');
});
'duplicate words',
true,
true,
true,
false,
false,
{},
dupedObject,
dupedObject
];
const ids = items.map(item => {
return setGuidFor(item);
});
const uniqueIds = uniq(ids);
const uniqueItems = uniq(items);
assert.equal(uniqueIds.length, uniqueItems.length, 'the number of unique ids matches the number of unique items');
});