-
Notifications
You must be signed in to change notification settings - Fork 27
Expand file tree
/
Copy pathexclude.js
More file actions
60 lines (51 loc) · 1.48 KB
/
exclude.js
File metadata and controls
60 lines (51 loc) · 1.48 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
/*!
* Consign exclude 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 options = {
cwd: 'test/test-app',
verbose: false
};
it('Should exclude controllers after loading all tests', function() {
var instance = consign(options).include('controllers, models').exclude('controllers')
, files = [
'models/one.js',
'models/three.js',
'models/two.js'
].map(function(file) {
return path.resolve(path.join(options.cwd, file));
})
;
assert.deepEqual(files, instance._files);
});
it('Should exclude models after loading all tests', function() {
var instance = consign(options).include('controllers, models').exclude('models')
, files = [
'controllers/one.js',
'controllers/three.js',
'controllers/two.js'
].map(function(file) {
return path.resolve(path.join(options.cwd, file));
})
;
assert.deepEqual(files, instance._files);
});
it('Should exclude specific file', function() {
var instance = consign(options).include('controllers').exclude('controllers/one.js')
, files = [
'controllers/three.js',
'controllers/two.js'
].map(function(file) {
return path.resolve(path.join(options.cwd, file));
})
;
assert.deepEqual(files, instance._files);
});
};