diff --git a/package.json b/package.json index b4e505c..eb05217 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,7 @@ }, "dependencies": {}, "devDependencies": { - "ava": "0.13.0", + "ava": "0.14.0", "coveralls": "2.11.9", "eslint": "2.7.0", "eslint-config-pedant": "0.1.1", diff --git a/test/add.js b/test/add.js index ab7ee4c..84b5813 100644 --- a/test/add.js +++ b/test/add.js @@ -10,7 +10,7 @@ test('should add value', t => { set.add(1); - t.same(Array.from(set), [1]); + t.deepEqual(Array.from(set), [1]); }); test('should not add existing value', t => { @@ -19,7 +19,7 @@ test('should not add existing value', t => { set.add(1); set.add(1); - t.same(Array.from(set), [1]); + t.deepEqual(Array.from(set), [1]); }); test('should support chains', t => { @@ -29,5 +29,5 @@ test('should support chains', t => { .add(1) .add(2); - t.same(Array.from(set), [1, 2]); + t.deepEqual(Array.from(set), [1, 2]); }); diff --git a/test/constructor.js b/test/constructor.js index a021236..707e4b3 100644 --- a/test/constructor.js +++ b/test/constructor.js @@ -8,19 +8,19 @@ const MySet = hashSet(x => x); test('should create empty set', t => { const set = new MySet(); - t.same(Array.from(set), []); + t.deepEqual(Array.from(set), []); }); test('should create set with array items', t => { const arr = [1, 2, 3]; const set = new MySet(arr); - t.same(Array.from(set), arr); + t.deepEqual(Array.from(set), arr); }); test('should create set with iterable items', t => { const iterable = (new Set([1, 2, 3])).values(); const set = new MySet(iterable); - t.same(Array.from(set), Array.from([1, 2, 3])); + t.deepEqual(Array.from(set), Array.from([1, 2, 3])); }); diff --git a/test/delete.js b/test/delete.js index 7426820..63ce355 100644 --- a/test/delete.js +++ b/test/delete.js @@ -13,7 +13,7 @@ test('should delete existing value', t => { set.delete(1); - t.same(Array.from(set), [2]); + t.deepEqual(Array.from(set), [2]); }); test('should not throw if deleted value is not exist', t => { @@ -21,5 +21,5 @@ test('should not throw if deleted value is not exist', t => { set.delete(1); - t.same(Array.from(set), []); + t.deepEqual(Array.from(set), []); }); diff --git a/test/hash-function.js b/test/hash-function.js index d1adb25..493c982 100644 --- a/test/hash-function.js +++ b/test/hash-function.js @@ -18,7 +18,7 @@ test('should add value but not hash', t => { set.add('kitty'); - t.same(Array.from(set), ['kitty']); + t.deepEqual(Array.from(set), ['kitty']); }); test('should add values with different hash', t => { @@ -27,7 +27,7 @@ test('should add values with different hash', t => { set.add('kitty'); set.add('puppy'); - t.same(Array.from(set), ['kitty', 'puppy']); + t.deepEqual(Array.from(set), ['kitty', 'puppy']); }); test('should not add value if other value with same hash', t => { @@ -36,5 +36,5 @@ test('should not add value if other value with same hash', t => { set.add('cat'); set.add('kitty'); - t.same(Array.from(set), ['cat']); + t.deepEqual(Array.from(set), ['cat']); }); diff --git a/test/iterators.js b/test/iterators.js index 392c74a..8ab7947 100644 --- a/test/iterators.js +++ b/test/iterators.js @@ -13,7 +13,7 @@ test('should be iterable', t => { arr.push(v); } - t.same(arr, [1, 2]); + t.deepEqual(arr, [1, 2]); }); test('forEach()', t => { @@ -22,23 +22,23 @@ test('forEach()', t => { set.forEach(v => arr.push(v)); - t.same(arr, [1, 2]); + t.deepEqual(arr, [1, 2]); }); test('entries()', t => { const set = new MySet([1, 2]); - t.same(Array.from(set.entries()), [1, 2]); + t.deepEqual(Array.from(set.entries()), [1, 2]); }); test('keys()', t => { const set = new MySet([1, 2]); - t.same(Array.from(set.keys()), [1, 2]); + t.deepEqual(Array.from(set.keys()), [1, 2]); }); test('values()', t => { const set = new MySet([1, 2]); - t.same(Array.from(set.values()), [1, 2]); + t.deepEqual(Array.from(set.values()), [1, 2]); }); diff --git a/test/mimic.js b/test/mimic.js index f294d4e..e2d3130 100644 --- a/test/mimic.js +++ b/test/mimic.js @@ -20,5 +20,5 @@ test('should return original Set with `valueOf()` method', t => { const originSet = (new Set([1, 2, 3]))._c; // AVA uses babel-runtime const mySet = new MySet([1, 2, 3]); - t.same(mySet.valueOf(), originSet); + t.deepEqual(mySet.valueOf(), originSet); });