UNPKG

519 Btext/coffeescriptView Raw
1path = require "path"
2wrench = require "wrench"
3Mocha = require "mocha"
4tests = __dirname
5
6by_js_extension = (filepath) -> /\.js$/.test filepath
7
8into_abs_path = (specs) -> (relpath) -> path.join specs, relpath
9
10run = (type) ->
11 runner = new Mocha
12 ui: "bdd"
13 reporter: "dot"
14
15 specs = path.join tests, type
16
17 runner.files = wrench.readdirSyncRecursive specs
18 .filter by_js_extension
19 .map into_abs_path specs
20
21 runner.run process.exit
22
23module.exports =
24 run: run