Skip to content

Commit 108928e

Browse files
committed
chapter 03: I created a seam in logAnalyzer, that seam enable the possibility of inject the dependency while are calling the function
1 parent 0c83251 commit 108928e

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

chapter_03-using-stubs-to-break-dependencies/LogAn/logAnalyzer.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
const ArgumentError = require('./ArgumentError');
2-
const fileExtensionManagerFactory = require('./fileExtensionManager');
32

4-
const fileExtensionManager = fileExtensionManagerFactory();
5-
6-
function logAnalyzer() {
3+
function logAnalyzer(extensionManager) {
74
/**
85
* @type {boolean}
96
*/
@@ -27,7 +24,7 @@ function logAnalyzer() {
2724
throw new ArgumentError('filename has to be provided');
2825
}
2926

30-
const result = await fileExtensionManager.isValid(fileName);
27+
const result = await extensionManager.isValid(fileName);
3128

3229
if (!result) {
3330
return false;

0 commit comments

Comments
 (0)