-
Notifications
You must be signed in to change notification settings - Fork 27
Expand file tree
/
Copy pathtests.js
More file actions
44 lines (37 loc) · 845 Bytes
/
tests.js
File metadata and controls
44 lines (37 loc) · 845 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/*!
* Consign config tests.
* Autoload your scripts.
*
* @author Jarrad Seers <jarrad@seers.me>
* @license MIT
*/
// Module dependencies.
var consign = require(__dirname + '/../')
, pack = require(__dirname + '/../package')
, path = require('path')
, assert = require('assert')
;
// Test file setup.
var tests = [
'config',
'locale',
'include',
'exclude',
'into'
];
function formatName(name) {
var parts = name.split('-');
for (var p in parts) {
var part = parts[p];
parts[p] = part.charAt(0).toUpperCase() + part.slice(1);
}
return parts.join(' ');
}
// Include unit tests.
describe(pack.name + ' v' + pack.version, function() {
tests.forEach(function(test) {
describe('Test case: ' + formatName(test), function() {
require(path.join(__dirname, test))(consign, assert);
});
});
});