Skip to content

Commit 61aaf59

Browse files
committed
fix: forece find in node_modules should work integ tests
1 parent 5c73790 commit 61aaf59

File tree

3 files changed

+52
-0
lines changed

3 files changed

+52
-0
lines changed

test/spec/FindInFiles-integ-test.js

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,56 @@ define(function (require, exports, module) {
259259
expect(fileResults.matches.length).toBe(3);
260260
});
261261

262+
it("should find all occurrences in node_modules folder", async function () {
263+
var dirEntry = FileSystem.getDirectoryForPath(testPath + "/node_modules/");
264+
await openSearchBar(dirEntry);
265+
await executeSearch("foo");
266+
267+
var fileResults = FindInFiles.searchModel.results[testPath + "/bar.txt"];
268+
expect(fileResults).toBeFalsy();
269+
270+
fileResults = FindInFiles.searchModel.results[testPath + "/foo.html"];
271+
expect(fileResults).toBeFalsy();
272+
273+
fileResults = FindInFiles.searchModel.results[testPath + "/foo.js"];
274+
expect(fileResults).toBeFalsy();
275+
276+
fileResults = FindInFiles.searchModel.results[testPath + "/css/foo.css"];
277+
expect(fileResults).toBeFalsy();
278+
279+
fileResults = FindInFiles.searchModel.results[testPath + "/node_modules/node_modules/test2.js"];
280+
expect(fileResults).toBeFalsy();
281+
282+
fileResults = FindInFiles.searchModel.results[testPath + "/node_modules/test.js"];
283+
expect(fileResults).toBeTruthy();
284+
expect(fileResults.matches.length).toBe(1);
285+
});
286+
287+
it("should find all occurrences in nested node_modules folder", async function () {
288+
var dirEntry = FileSystem.getDirectoryForPath(testPath + "/node_modules/node_modules/");
289+
await openSearchBar(dirEntry);
290+
await executeSearch("foo");
291+
292+
var fileResults = FindInFiles.searchModel.results[testPath + "/bar.txt"];
293+
expect(fileResults).toBeFalsy();
294+
295+
fileResults = FindInFiles.searchModel.results[testPath + "/foo.html"];
296+
expect(fileResults).toBeFalsy();
297+
298+
fileResults = FindInFiles.searchModel.results[testPath + "/foo.js"];
299+
expect(fileResults).toBeFalsy();
300+
301+
fileResults = FindInFiles.searchModel.results[testPath + "/css/foo.css"];
302+
expect(fileResults).toBeFalsy();
303+
304+
fileResults = FindInFiles.searchModel.results[testPath + "/node_modules/test.js"];
305+
expect(fileResults).toBeFalsy();
306+
307+
fileResults = FindInFiles.searchModel.results[testPath + "/node_modules/node_modules/test2.js"];
308+
expect(fileResults).toBeTruthy();
309+
expect(fileResults.matches.length).toBe(1);
310+
});
311+
262312
it("should find all occurences in single file", async function () {
263313
var fileEntry = FileSystem.getFileForPath(testPath + "/foo.js");
264314
await openSearchBar(fileEntry);

test/spec/FindReplace-test-files/node_modules/node_modules/test2.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/spec/FindReplace-test-files/node_modules/test.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)