Skip to content

Commit 8c6f614

Browse files
authored
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.
1 parent 1ece4a5 commit 8c6f614

File tree

1 file changed

+4
-4
lines changed
  • 1-js/06-advanced-functions/09-call-apply-decorators/01-spy-decorator/_js.view

1 file changed

+4
-4
lines changed

1-js/06-advanced-functions/09-call-apply-decorators/01-spy-decorator/_js.view/test.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ describe("spy", function() {
2424
let wrappedSum = spy(sum);
2525

2626
assert.equal(wrappedSum(1, 2), 3);
27-
assert(spy.calledWith(1, 2));
27+
assert(sum.calledWith(1, 2));
2828
});
2929

3030

@@ -37,8 +37,8 @@ describe("spy", function() {
3737
calc.wrappedSum = spy(calc.sum);
3838

3939
assert.equal(calculator.wrappedSum(1, 2), 3);
40-
assert(spy.calledWith(1, 2));
41-
assert(spy.calledOn(calculator));
40+
assert(calc.sum.calledWith(1, 2));
41+
assert(calc.sum.calledOn(calculator));
4242
});
4343

44-
});
44+
});

0 commit comments

Comments
 (0)