From bc0ce96b63c571e13eea0584fbd41a0f923f71fb Mon Sep 17 00:00:00 2001 From: Michael Best Date: Sun, 24 May 2015 14:42:30 -1000 Subject: [PATCH] Also verify that exception doesn't get thrown again (that the item isn't processed again). --- spec/defaultBindings/foreachBehaviors.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/defaultBindings/foreachBehaviors.js b/spec/defaultBindings/foreachBehaviors.js index 620d9d89e..9852bcec1 100644 --- a/spec/defaultBindings/foreachBehaviors.js +++ b/spec/defaultBindings/foreachBehaviors.js @@ -246,10 +246,10 @@ describe('Binding: Foreach', function() { ko.applyBindings({someItems: someItems, callback, callback }); expect(testNode.childNodes[0]).toContainText('ABC'); - try { someItems.push('D'); } catch(e) {} + expect(function() { someItems.push('D'); }).toThrow("Exception"); expect(testNode.childNodes[0]).toContainText('ABCD'); - try { someItems.push('E'); } catch(e) {} + expect(function() { someItems.push('E'); }).not.toThrow(); expect(testNode.childNodes[0]).toContainText('ABCDE'); });