Make interactive test running work with ‘test’ directory

In addition to ‘spec’. I hate the word ‘spec’.
This commit is contained in:
Nathan Sobo
2016-06-16 16:26:22 -06:00
parent 56a9894896
commit 07a19df22c

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