Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
'use strict';
const metaschema = require('metaschema');
const metatests = require('metatests');
const { Uint64 } = require('@metarhia/common');
const { options, config } = require('../lib/metaschema-config/config');
const { ValidationError, MetaschemaError } = metaschema.errors;
metatests.test('Fully supports schemas/system', async test => {
let schema;
try {
schema = await metaschema.fs.load(
'test/fixtures/validate',
options,
config
);
} catch (error) {
console.error(error);
test.fail(error);
test.end();
return;
}
'use strict';
const metaschema = require('metaschema');
const metatests = require('metatests');
const { options, config } = require('../lib/metaschema-config/config');
const { SchemaValidationError, MetaschemaError } = metaschema.errors;
metatests.test('Fully supports schemas/system', async test => {
try {
await metaschema.fs.load(
'test/fixtures/detail-with-hierarchy',
options,
config
);
} catch (error) {
test.strictSame(
error,
new MetaschemaError([
new SchemaValidationError('detailHierarchy', 'Detail', {
type: 'Subsystem',
master: 'Master',
}),