       soFar += (if soFar then pathSep else "") + dir
 
 discoverTests = (dir) ->
-  dir ||= if isComponent() then join(testDirectory(), "static") else "static"
+  dir ||= join testDirectory(), "static"
   return [] if not exists dir
   results = []
   t.dfs dirTree = {path: "."}, (n) ->

    port = process.env.PORT || 1335
    host = process.env.HOST || "localhost"
    components = allComponents()
    testDirName = testDirectory()
    staticDirName = join (if isComponent() then testDirName else ""), "static"
    return listTests(discoverTests(staticDirName), host, port) if argv.list
    commands.install()
    tests = discoverTests staticDirName

sourceDirectory = (dir = ".") ->
  pkgJson(dir).component?.sourceDirectory || "src"

testDirectory = exports.testDirectory = (dir = ".") ->
  pkgJson(dir).component?.testDirectory or (exists("static") and ".") or ".test"

testTemplate = (dir = ".") ->
  tt = pkgJson(dir).component?.testTemplate
