Skip to content

Commit 6064349

Browse files
cironunesrodyhaddad
authored andcommitted
chore(tests): setup tests infrastructure
1 parent c9fbc5a commit 6064349

File tree

2 files changed

+24
-1
lines changed

2 files changed

+24
-1
lines changed

package.json

+5-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
},
99
"keywords": [],
1010
"scripts": {
11-
"test": "echo \"Error: no test specified\" && exit 1"
11+
"test": "node tests/runner"
1212
},
1313
"repository": {
1414
"type": "git",
@@ -43,5 +43,9 @@
4343
"./addon/ng2/",
4444
"./node_modules/angular-project-draft/"
4545
]
46+
},
47+
"devDependencies": {
48+
"glob": "^5.0.14",
49+
"mocha": "^2.2.5"
4650
}
4751
}

tests/runner.js

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
'use strict';
2+
3+
var Mocha = require('mocha');
4+
var glob = require('glob');
5+
6+
var root = 'tests/{unit,acceptance}';
7+
var specFiles = glob.sync(root + '/**/*.spec.js');
8+
var mocha = new Mocha({
9+
timeout: 5000,
10+
reporter: 'spec'
11+
});
12+
13+
specFiles.forEach(mocha.addFile.bind(mocha));
14+
15+
mocha.run(function(failures){
16+
process.on('exit', function () {
17+
process.exit(failures);
18+
});
19+
});

0 commit comments

Comments
 (0)