Files
xen-orchestra/run-tests
2015-03-06 15:32:38 +01:00

33 lines
627 B
CoffeeScript
Executable File

#!/usr/bin/env coffee
# Some modules are written in ES6.
require('babel/register')
# Tests runner.
$mocha = require 'mocha'
# Used to find the specification files.
$glob = require 'glob'
#=====================================================================
do ->
# Instantiates the tests runner.
mocha = new $mocha {
reporter: 'spec'
}
# Processes arguments.
do ->
{argv} = process
i = 2
n = argv.length
mocha.grep argv[i++] while i < n
$glob 'src/**/*.spec.{coffee,js}', (error, files) ->
console.error(error) if error
mocha.addFile file for file in files
mocha.run( -> )