webapi-eca/unit_tests.sh

17 lines
445 B
Bash
Raw Normal View History

#!/usr/bin/env node
2014-02-19 16:04:49 +00:00
process.chdir( __dirname );
var fs = require( 'fs' );
var path = require( 'path' );
var nodeunit = require( 'nodeunit' );
var args = process.argv.slice( 2 );
if( args[ 0 ] !== undefined ) {
var fl = path.resolve( args[ 0 ] );
if ( fs.existsSync( fl ) ) {
nodeunit.reporters.default.run( [ fl ] );
} else {
console.error( 'File not found!!' );
}
} else {
2014-02-19 16:04:49 +00:00
nodeunit.reporters.default.run( [ 'testing' ] );
}