Skip to content

Commit 7d3d57e

Browse files
Fix Downloads Reader
1 parent 2a081c3 commit 7d3d57e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

e2e/utils/testData.util.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,10 @@ class TestData {
103103
* Find all files recursively in specific folder with specific extension, e.g:
104104
* findFilesInDir('./project/src', '.html') ==> ['./project/src/a.html','./project/src/build/index.html']
105105
* @param {String} startPath Path relative to this file or other file which requires this files
106-
* @param {String} filter Extension name, e.g: '.html'
106+
* @param {String} extension Extension name, e.g: '.html'
107107
* @return {Array} Result files with path string in an array
108108
*/
109-
findFilesInDir = (pathFromDataFolder, filter: string): Array<string> => {
109+
findFilesInDir = (pathFromDataFolder, extension: string): Array<string> => {
110110
const startPath = this.getFullPath(`${pathFromDataFolder}`);
111111
let results = [];
112112

@@ -120,8 +120,8 @@ class TestData {
120120
const filename = path.join(startPath, files[i]);
121121
const stat = fs.lstatSync(filename);
122122
if (stat.isDirectory()) {
123-
results = results.concat(this.findFilesInDir(filename, filter));
124-
} else if (filename.indexOf(filter) >= 0) {
123+
results = results.concat(this.findFilesInDir(filename, extension));
124+
} else if (filename.endsWith(extension)) {
125125
logger.info(`Found File: ${filename}`);
126126
results.push(filename);
127127
}

0 commit comments

Comments
 (0)