-
Notifications
You must be signed in to change notification settings - Fork 360
/
Copy pathvalidation.test.js
30 lines (24 loc) · 998 Bytes
/
validation.test.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
var expect = require('chai').expect,
path = require('path'),
package = require(path.resolve('.', 'package.json'));
describe('package.json', function () {
it('should have com_postman_plugin object with valid properties', function () {
expect(package).to.have.property('com_postman_plugin');
expect(package.com_postman_plugin.type).to.equal('code_generator');
expect(package.com_postman_plugin.lang).to.be.a('string');
expect(package.com_postman_plugin.variant).to.be.a('string');
expect(package.com_postman_plugin.syntax_mode).to.be.equal('java');
});
it('should have main property with relative path to object with convert property', function () {
var languageModule;
expect(package.main).to.be.a('string');
try {
languageModule = require(path.resolve('.', package.main));
}
catch (error) {
console.error(error);
}
expect(languageModule).to.be.a('object');
expect(languageModule.convert).to.be.a('function');
});
});