We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7454c07 commit 62f7609Copy full SHA for 62f7609
spec/helper.ts
@@ -84,10 +84,11 @@ export function runHandler(
84
}
85
86
87
- public write(writeBody: any, cb: () => void = () => {}) {
+ public write(writeBody: any, cb?: () => void) {
88
this.sentBody += typeof writeBody === "object" ? JSON.stringify(writeBody) : writeBody;
89
- // N.B. setImmediate breaks sinon.
90
- setImmediate(cb);
+ if (cb) {
+ setImmediate(cb);
91
+ }
92
return true;
93
94
0 commit comments