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:
Valerii Iatsko 2017-10-01 09:34:43 +02:00 committed by GitHub
parent 1ece4a5b61
commit 8c6f614dc4

View file

@ -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));
});
});
});