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.
This commit is contained in:
parent
1ece4a5b61
commit
8c6f614dc4
1 changed files with 4 additions and 4 deletions
|
@ -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));
|
||||
});
|
||||
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue