     temporaryFilePath = null
 
     beforeEach ->
-      temporaryFilePath = fs.join(require.resolve('fixtures/tree-view'), 'temporary')
+      temporaryFilePath = fs.join(fs.resolveOnLoadPath('fixtures/tree-view'), 'temporary')
       if fs.exists(temporaryFilePath)
         fs.remove(temporaryFilePath)
         waits(20)

    [ignoreFile] = []

    beforeEach ->
      ignoreFile = fs.join(require.resolve('fixtures/tree-view'), '.gitignore')
      fs.write(ignoreFile, 'tree-view.js')
      config.set "core.hideGitIgnoredFiles", false



      sampleJs.trigger clickEvent(originalEvent: { detail: 1 })
      expect(sampleJs).toHaveClass 'selected'
      expect(rootView.getActiveView().getPath()).toBe fs.resolveOnLoadPath('fixtures/tree-view/tree-view.js')
      expect(rootView.getActiveView().isFocused).toBeFalsy()

      sampleTxt.trigger clickEvent(originalEvent: { detail: 1 })
      expect(sampleTxt).toHaveClass 'selected'
      expect(treeView.find('.selected').length).toBe 1
      expect(rootView.getActiveView().getPath()).toBe fs.resolveOnLoadPath('fixtures/tree-view/tree-view.txt')
      expect(rootView.getActiveView().isFocused).toBeFalsy()

  describe "when a file is double-clicked", ->
    it "selects the file and opens it in the active editor on the first click, then changes focus to the active editor on the second", ->
      sampleJs.trigger clickEvent(originalEvent: { detail: 1 })
      expect(sampleJs).toHaveClass 'selected'
      expect(rootView.getActiveView().getPath()).toBe fs.resolveOnLoadPath('fixtures/tree-view/tree-view.js')
      expect(rootView.getActiveView().isFocused).toBeFalsy()

      sampleJs.trigger clickEvent(originalEvent: { detail: 2 })
