-
Notifications
You must be signed in to change notification settings - Fork 27
Expand file tree
/
Copy pathconfig.js
More file actions
62 lines (51 loc) · 1.72 KB
/
config.js
File metadata and controls
62 lines (51 loc) · 1.72 KB
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
/*!
* Consign config tests.
* Autoload your scripts.
*
* @author Jarrad Seers <jarrad@seers.me>
* @license MIT
*/
// Module dependencies.
var path = require('path');
module.exports = function(consign, assert) {
// Test setup.
var cwd = path.resolve('test/test-app/controllers')
, verbose = false
;
it('Should set verbose to false', function() {
var instance = consign({verbose: false});
assert.equal(false, instance._options.verbose);
});
it('Should set a custom logger', function() {
var logger = { hello: true, info: function() {} }
, instance = consign({logger: logger, verbose: verbose})
;
return 'hello' in instance._options.logger;
});
it('Should default to console with no logger option', function() {
var instance = consign({verbose: verbose});
return 'log' in instance._options.logger;
});
it('Should set the woking directory to `' + cwd + '`', function() {
var instance = consign({cwd: cwd, verbose: verbose});
return assert.equal(instance._options.cwd, cwd);
});
it('Should add a new possible extension', function() {
var extension = '.hello'
, instance = consign({extensions: extension, verbose: verbose})
;
return assert.equal(instance._options.extensions.indexOf(extension), 0);
});
it('Should load the en-nz locale instead of default en-us', function() {
var locale = 'en-nz'
, us = 'Initialized in'
, nz = 'Initialised in'
, instance = consign({locale: locale, verbose: verbose})
;
return assert.equal(instance._[us], nz);
});
it('Should disable watch feature', function() {
var instance = consign({watch: false, verbose: verbose});
return assert.equal(instance._options.watch, false);
});
};