How to use the metaschema.errors function in metaschema

To help you get started, we’ve selected a few metaschema examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github metarhia / globalstorage / test / ms.validate.js View on Github external
'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;
  }
github metarhia / globalstorage / test / ms.config.detail-with-hierarchy.js View on Github external
'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',
        }),

metaschema

Metadata Schema and Interface Definition Language (IDL)

MIT
Latest version published 4 months ago

Package Health Score

71 / 100
Full package analysis