From ecbf8cd72216b9170ccd9073e57a4e3daa3265b8 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Tue, 7 Jun 2016 07:08:33 -0700 Subject: [PATCH] Add map cache test for changing values. --- test/test.js | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/test/test.js b/test/test.js index 7bd1a98c9..d835a1ba3 100644 --- a/test/test.js +++ b/test/test.js @@ -1036,8 +1036,8 @@ 'large stacks': largeStack }; - lodashStable.forOwn(caches, function(cache, key) { - QUnit.test('should implement a `Map` interface for ' + key, function(assert) { + lodashStable.forOwn(caches, function(cache, kind) { + QUnit.test('should implement a `Map` interface for ' + kind, function(assert) { assert.expect(82); lodashStable.each(keys, function(key, index) { @@ -1058,6 +1058,18 @@ return !cache.has(key); })); }); + + QUnit.test('should support changing values of ' + kind, function(assert) { + assert.expect(10); + + lodashStable.each(keys, function(key) { + cache.set(key, 1); + cache.set(key, 2); + + assert.strictEqual(cache.get(key), 2); + cache.clear(); + }); + }); }); }());