From 8c6f614dc4f5db82495b01b4944f37ab8f58842d Mon Sep 17 00:00:00 2001 From: Valerii Iatsko Date: Sun, 1 Oct 2017 09:34:43 +0200 Subject: [PATCH] Fixed spy-decorator assignment test Hi! We should be checking here original function not spy to ensure that we are wrapping transparently. The test wasn't working and probably that was just a "typo" to begin with. This makes it work properly. --- .../01-spy-decorator/_js.view/test.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/1-js/06-advanced-functions/09-call-apply-decorators/01-spy-decorator/_js.view/test.js b/1-js/06-advanced-functions/09-call-apply-decorators/01-spy-decorator/_js.view/test.js index 7e84f3c9..b9347c90 100644 --- a/1-js/06-advanced-functions/09-call-apply-decorators/01-spy-decorator/_js.view/test.js +++ b/1-js/06-advanced-functions/09-call-apply-decorators/01-spy-decorator/_js.view/test.js @@ -24,7 +24,7 @@ describe("spy", function() { let wrappedSum = spy(sum); assert.equal(wrappedSum(1, 2), 3); - assert(spy.calledWith(1, 2)); + assert(sum.calledWith(1, 2)); }); @@ -37,8 +37,8 @@ describe("spy", function() { calc.wrappedSum = spy(calc.sum); assert.equal(calculator.wrappedSum(1, 2), 3); - assert(spy.calledWith(1, 2)); - assert(spy.calledOn(calculator)); + assert(calc.sum.calledWith(1, 2)); + assert(calc.sum.calledOn(calculator)); }); -}); \ No newline at end of file +});