Skip to content

Commit 2c44a3a

Browse files
committed
chapter 03: create a new fake that is ready to be configurable to use in test
1 parent bdce009 commit 2c44a3a

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
function fakeExtensionManager() {
2+
/**
3+
* @type {boolean}
4+
*/
5+
let valid = false;
6+
7+
function willBeValid(value) {
8+
valid = value;
9+
}
10+
11+
/**
12+
* @param {string} fileName
13+
*/
14+
function isValid(fileName) {
15+
return valid;
16+
}
17+
18+
return {
19+
willBeValid,
20+
isValid,
21+
};
22+
}
23+
module.exports = fakeExtensionManager;

0 commit comments

Comments
 (0)