describe('test/client/utils.test.js', () => { it('should nextId ok', () => { mm(utils, 'id', Math.pow(2, 30)); assert(utils.nextId() === 1); assert(utils.nextId() === 2); }); it('should shuffle ok', () => { const arr = utils.shuffle([ 1, 2, 3, 4, 5, 6 ]); console.log(arr); assert.notDeepEqual(arr, [ 1, 2, 3, 4, 5, 6 ]); }); });
assert.deepEqual(nm.matchKeys({a: 'a', b: 'b', c: 'c'}, '[a-b]'), {a: 'a', b: 'b'}); assert.deepEqual(nm.matchKeys({a: 'a', b: 'b', c: 'c'}, '(a|c)'), {a: 'a', c: 'c'}); assert.notDeepEqual(nm.matchKeys({a: 'a', b: 'b', c: 'c'}, 'a'), {b: 'b'}); }); assert.deepEqual(nm.matchKeys({a: 'a', b: 'b', c: 'c'}, /[a-b]/), {a: 'a', b: 'b'}); assert.deepEqual(nm.matchKeys({a: 'a', b: 'b', c: 'c'}, /(a|c)/), {a: 'a', c: 'c'}); assert.notDeepEqual(nm.matchKeys({a: 'a', b: 'b', c: 'c'}, /a/), {b: 'b'}); }); });
assert.notDeepEqual(collectionDoc.content, parsed) function assertKeyNameNoDollar (obj) { if (typeof obj === 'object') {
var noFollowSync = glob.sync(pattern).sort(); assert.notDeepEqual(followSync, noFollowSync, 'followSync should not equal noFollowSync'); assert.notDeepEqual(follow, noFollow, 'follow should not equal noFollow'); var noFollowSync = glob.sync(pattern).sort(); assert.notDeepEqual(followSync, noFollowSync, 'followSync should not equal noFollowSync'); assert.notDeepEqual(follow, noFollow, 'follow should not equal noFollow');
assert.notStrictEqual(math, math2); assert.notStrictEqual(math1, math2); assert.notDeepEqual(math1.config(), math2.config()); assert.notDeepEqual(math.config(), math2.config());
const two = clone(one); two.c = 'd'; assert.notDeepEqual(one, two); }); const arr2 = clone(arr1); one.c = 'd'; assert.notDeepEqual(arr1, arr2); }); const b = clone(a); a.set(2, 4); assert.notDeepEqual(Array.from(a), Array.from(b)); }); const b = clone(a); a.add(8); assert.notDeepEqual(Array.from(a), Array.from(b)); }); assert.notDeepEqual(a, b); assert.notEqual(a.z, b.z, 'Root property of original object not expected to be changed'); assert.notEqual(a.y.x, b.y.x, 'Nested property of original object not expected to be changed'); assert.notDeepEqual(a, b); assert.notEqual(a.z, b.z, 'Root property of original object not expected to be changed'); assert.equal(a.y.x, b.y.x);