Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
test('protosCorrect', t => {
const protoRoot = loadProtos();
// Test a basic primitive out
const examplesDir = path.join(getModuleDir(), 'examples');
const validator = new XVIZValidator();
// For each protobuf type
const protoTypes = getXVIZProtoTypes(protoRoot);
t.ok(protoTypes.length > 5, 'Have protos connected to schemas');
const protoEnumTypes = getProtoEnumTypes(protoRoot);
t.ok(Object.keys(protoEnumTypes).length > 5, 'Found enum types');
const tests = [];
for (let i = 0; i < protoTypes.length; i++) {
const type = protoTypes[i];
const schemaName = type.options[EXTENSION_PROPERTY];
t.comment(schemaName);
// Make sure we have a matching JSON schema
t.ok(validator.hasSchema(schemaName), `"${schemaName}" is a real schema`);