Skip to content

Commit 81b1a9e

Browse files
author
Moti Shani
committed
use stub.(obj,meth).callsFake(fn) as stub(obj, 'meth', fn) has been removed
1 parent 7059b9f commit 81b1a9e

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

article1.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,9 +156,10 @@ Now that `tax.calculate` has been created, we can stub it out with our pre-progr
156156
var sinon = require('sinon');
157157
var tax = require('./../../src/part1/tax');
158158

159+
159160
describe('getTax()', function() {
160161
beforeEach(function() {
161-
sinon.stub(tax, 'calculate', function(subtotal, state, done) {
162+
sinon.stub(tax, 'calculate').callsFake(function(subtotal, state, done) {
162163
setTimeout(function() {
163164
done({
164165
amount: 30

tests/part1/cart-summary-test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ var tax = require('./../../src/part1/tax');
66

77
describe('CartSummary', function() {
88
beforeEach(function() {
9-
sinon.stub(tax, 'calculate', function(subtotal, state, done) {
9+
sinon.stub(tax, 'calculate').callsFake(function(subtotal, state, done) {
1010
setTimeout(function() {
1111
done({
1212
amount: 30

0 commit comments

Comments
 (0)