mirror of
https://github.com/atom/atom.git
synced 2026-04-28 03:01:47 -04:00
Project::scan uses core.ignoredNames
This commit is contained in:
@@ -358,19 +358,17 @@ describe "Project", ->
|
||||
expect(paths[0]).toBe filePath
|
||||
expect(matches.length).toBe 1
|
||||
|
||||
xit "excludes values in core.ignoredNames", ->
|
||||
# FIXME: this test doesnt make any sense. Why should it ignore the whole project dir?
|
||||
projectPath = '/tmp/atom-tests/folder-with-dot-git/.git'
|
||||
filePath = path.join(projectPath, 'test.txt')
|
||||
fs.writeSync(filePath, 'match this')
|
||||
project.setPath(projectPath)
|
||||
paths = []
|
||||
matches = []
|
||||
it "excludes values in core.ignoredNames", ->
|
||||
projectPath = path.join(__dirname, 'fixtures', 'git', 'working-dir')
|
||||
ignoredNames = config.get("core.ignoredNames")
|
||||
ignoredNames.push("a")
|
||||
config.set("core.ignoredNames", ignoredNames)
|
||||
|
||||
resultHandler = jasmine.createSpy("result found")
|
||||
waitsForPromise ->
|
||||
project.scan /match/, (result) ->
|
||||
paths.push(result.path)
|
||||
matches.push(result.matchText)
|
||||
project.scan /dollar/, (results) ->
|
||||
console.log results
|
||||
resultHandler()
|
||||
|
||||
runs ->
|
||||
expect(paths.length).toBe 0
|
||||
expect(matches.length).toBe 0
|
||||
expect(resultHandler).not.toHaveBeenCalled()
|
||||
|
||||
@@ -294,7 +294,7 @@ class Project
|
||||
inclusions: options.paths
|
||||
includeHidden: true
|
||||
excludeVcsIgnores: config.get('core.excludeVcsIgnoredPaths')
|
||||
# args.unshift('--ignore', ignoredNames.join(',')) if ignoredNames.length > 0
|
||||
exclusions: config.get('core.ignoredNames')
|
||||
|
||||
task = Task.once require.resolve('./scan-handler'), @getPath(), regex.source, searchOptions, ->
|
||||
deferred.resolve()
|
||||
|
||||
Reference in New Issue
Block a user