blob: 1541219cf1bba0123c67d1c09e3e39592a36acd2 (
plain)
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
|
var jsonschema = require('jsonschema');
var schema = require('../configSchema');
describe('configSchema', function() {
function validate(cfg) {
var v = new jsonschema.Validator();
return v.validate(cfg, schema, {
propertyName: 'config'
});
}
describe('structure', function() {
it('should accept dot in filename', function() {
var result = validate({
structure: {
readme: 'book-intro.adoc'
}
});
expect(result.errors.length).toBe(0);
});
it('should not accept filepath', function() {
var result = validate({
structure: {
readme: 'folder/myFile.md'
}
});
expect(result.errors.length).toBe(1);
});
});
});
|