Merge pull request #11994 from atom/ns-allow-test-directory

Make interactive package tests work with a top-level 'test' directory
This commit is contained in:
Antonio Scandurra 2016-06-17 11:15:48 +02:00 committed by GitHub
commit 89f6604f91

View File

@ -1,5 +1,6 @@
{ipcRenderer} = require 'electron'
path = require 'path'
fs = require 'fs-plus'
{Disposable, CompositeDisposable} = require 'event-kit'
Grim = require 'grim'
scrollbarStyle = require 'scrollbar-style'
@ -122,6 +123,12 @@ class WorkspaceElement extends HTMLElement
[projectPath] = @project.relativizePath(activePath)
else
[projectPath] = @project.getPaths()
ipcRenderer.send('run-package-specs', path.join(projectPath, 'spec')) if projectPath
if projectPath
specPath = path.join(projectPath, 'spec')
testPath = path.join(projectPath, 'test')
if not fs.existsSync(specPath) and fs.existsSync(testPath)
specPath = testPath
ipcRenderer.send('run-package-specs', specPath)
module.exports = WorkspaceElement = document.registerElement 'atom-workspace', prototype: WorkspaceElement.prototype