Skip to content

Commit 3fb65ab

Browse files
committed
chapter 04: fixing fakeWebService, create getter and return both object with the two functions
1 parent c51ced2 commit 3fb65ab

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

chapter_04-interaction-testing-using-mock-objects/LogAn/fakes/fakeWebService.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,15 @@ function fakeWebService() {
77
function logError(message) {
88
lastError = message;
99
}
10+
11+
function getLastError() {
12+
return lastError;
13+
}
14+
15+
return {
16+
logError,
17+
getLastError,
18+
};
1019
}
1120

1221
module.exports = fakeWebService;

0 commit comments

Comments
 (0)