Simplify testing harness
This commit is contained in:
parent
5eb7bcdc0e
commit
f9d39151af
2
Makefile
2
Makefile
|
@ -1,5 +1,5 @@
|
|||
BIN := ./node_modules/.bin
|
||||
TEST_FILES := test/support/globals.js $(shell find test/specs -type f -name "*.js")
|
||||
TEST_FILES := test/support.js $(shell find test/specs -type f -name "*.js")
|
||||
|
||||
VERSION := $(shell node -e "console.log(require('./package.json').version)")
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@ var path = require('path');
|
|||
var chai = require('chai');
|
||||
var sinonChai = require('sinon-chai');
|
||||
|
||||
require('./../..');
|
||||
require('..');
|
||||
Logger.setup(false) // disable Cylon's logger for tests
|
||||
|
||||
global.chai = chai;
|
||||
|
@ -23,7 +23,7 @@ global.stub = sinon.stub
|
|||
// can be used by test modules to require production modules,
|
||||
// relative to the base path (where the Gruntfile.js also lives)
|
||||
global.source = function (src) {
|
||||
var resource = path.normalize('../../lib/' + src);
|
||||
var resource = path.normalize('../lib/' + src);
|
||||
return require(resource);
|
||||
};
|
||||
|
|
@ -1,25 +0,0 @@
|
|||
'use strict';
|
||||
|
||||
require('./globals');
|
||||
|
||||
var grunt = require('grunt');
|
||||
var Mocha = require('mocha');
|
||||
|
||||
var mocha = new Mocha({ reporter: 'spec', ui: 'bdd'});
|
||||
|
||||
function run(cb) {
|
||||
var files = grunt.file.expand(__dirname + '/../dist/**/*.spec.js');
|
||||
console.log(files)
|
||||
files.forEach(function (file) {
|
||||
mocha.addFile(file);
|
||||
});
|
||||
|
||||
cb();
|
||||
}
|
||||
|
||||
run(function (err) {
|
||||
if (err) { throw err; }
|
||||
mocha.run(function (failures) {
|
||||
process.exit(failures);
|
||||
});
|
||||
});
|
Loading…
Reference in New Issue