-
-
Notifications
You must be signed in to change notification settings - Fork 76
/
Copy pathpartial-keyword.js
45 lines (37 loc) · 1.17 KB
/
partial-keyword.js
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
var schema = require('../mappings/partial/keyword');
module.exports.tests = {};
module.exports.tests.compile = function(test, common) {
test('valid schema file', function(t) {
t.equal(typeof schema, 'object', 'schema generated');
t.equal(Object.keys(schema).length>0, true, 'schema has body');
t.end();
});
};
// this should never need to change
module.exports.tests.type = function(test, common) {
test('correct type', function(t) {
t.equal(schema.type, 'keyword', 'correct value');
t.end();
});
};
module.exports.tests.store = function(test, common) {
test('store unset (will not be stored)', function(t) {
t.equal(schema.store, undefined, 'unset');
t.end();
});
};
// do not perform analysis on categories
module.exports.tests.analysis = function(test, common) {
test('index analysis disabled', function(t) {
t.equal(schema.index, undefined, 'should be set to default');
t.end();
});
};
module.exports.all = function (tape, common) {
function test(name, testFunction) {
return tape('keyword: ' + name, testFunction);
}
for( var testCase in module.exports.tests ){
module.exports.tests[testCase](test, common);
}
};