Skip to content

Commit

Permalink
test(definitions): move models to models dir
Browse files Browse the repository at this point in the history
  • Loading branch information
Pakisan committed May 22, 2024
1 parent 32c4733 commit 0b248c9
Show file tree
Hide file tree
Showing 41 changed files with 39 additions and 37 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ const ajv = new Ajv({
});
addFormats(ajv);

const infoJsonSchema = require('../../../../definitions/3.0.0/contact.json');
const infoJsonSchema = require('../../../../../definitions/3.0.0/contact.json');
const validator = ajv
.addMetaSchema(require('../../../../definitions/3.0.0/schema.json'))
.addSchema(require('../../../../definitions/3.0.0/specificationExtension.json'))
.addMetaSchema(require('../../../../../definitions/3.0.0/schema.json'))
.addSchema(require('../../../../../definitions/3.0.0/specificationExtension.json'))
.compile(infoJsonSchema);

describe('Contact', () => {
Expand Down
File renamed without changes.
8 changes: 8 additions & 0 deletions test/definitions/3.0.0/models/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
describe('Models', () => {
require('./info/info.js');
require('./info extensions/info-extension.js');
require('./contact/contact.js');
require('./license/license.js');
require('./reference/reference.js');
require('./reference object/reference-object.js');
});
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ const ajv = new Ajv({
});
addFormats(ajv);

const infoJsonSchema = require('../../../../definitions/3.0.0/infoExtensions.json');
const infoJsonSchema = require('../../../../../definitions/3.0.0/infoExtensions.json');
const validator = ajv
.addMetaSchema(require('../../../../definitions/3.0.0/schema.json'))
.addSchema(require('../../../../extensions/linkedin/0.1.0/schema.json'))
.addSchema(require('../../../../extensions/x/0.1.0/schema.json'))
.addMetaSchema(require('../../../../../definitions/3.0.0/schema.json'))
.addSchema(require('../../../../../extensions/linkedin/0.1.0/schema.json'))
.addSchema(require('../../../../../extensions/x/0.1.0/schema.json'))
.compile(infoJsonSchema);

describe('InfoExtensions', () => {
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,20 @@ const ajv = new Ajv({
});
addFormats(ajv);

const infoJsonSchema = require('../../../../definitions/3.0.0/info.json');
const infoJsonSchema = require('../../../../../definitions/3.0.0/info.json');
const validator = ajv
.addMetaSchema(require('../../../../definitions/3.0.0/schema.json'))
.addSchema(require('../../../../definitions/3.0.0/infoExtensions.json'))
.addSchema(require('../../../../definitions/3.0.0/contact.json'))
.addSchema(require('../../../../definitions/3.0.0/license.json'))
.addSchema(require('../../../../examples/3.0.0/ReferenceObject.json'))
.addSchema(require('../../../../definitions/3.0.0/ReferenceObject.json'))
.addSchema(require('../../../../definitions/3.0.0/Reference.json'))
.addSchema(require('../../../../definitions/3.0.0/tag.json'))
.addSchema(require('../../../../definitions/3.0.0/externalDocs.json'))
.addSchema(require('../../../../definitions/3.0.0/specificationExtension.json'))
.addSchema(require('../../../../extensions/linkedin/0.1.0/schema.json'))
.addSchema(require('../../../../extensions/x/0.1.0/schema.json'))
.addMetaSchema(require('../../../../../definitions/3.0.0/schema.json'))
.addSchema(require('../../../../../definitions/3.0.0/infoExtensions.json'))
.addSchema(require('../../../../../definitions/3.0.0/contact.json'))
.addSchema(require('../../../../../definitions/3.0.0/license.json'))
.addSchema(require('../../../../../examples/3.0.0/ReferenceObject.json'))
.addSchema(require('../../../../../definitions/3.0.0/ReferenceObject.json'))
.addSchema(require('../../../../../definitions/3.0.0/Reference.json'))
.addSchema(require('../../../../../definitions/3.0.0/tag.json'))
.addSchema(require('../../../../../definitions/3.0.0/externalDocs.json'))
.addSchema(require('../../../../../definitions/3.0.0/specificationExtension.json'))
.addSchema(require('../../../../../extensions/linkedin/0.1.0/schema.json'))
.addSchema(require('../../../../../extensions/x/0.1.0/schema.json'))
.compile(infoJsonSchema);

describe('Info', () => {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ const ajv = new Ajv({
});
addFormats(ajv);

const infoJsonSchema = require('../../../../definitions/3.0.0/license.json');
const infoJsonSchema = require('../../../../../definitions/3.0.0/license.json');
const validator = ajv
.addMetaSchema(require('../../../../definitions/3.0.0/schema.json'))
.addSchema(require('../../../../definitions/3.0.0/specificationExtension.json'))
.addMetaSchema(require('../../../../../definitions/3.0.0/schema.json'))
.addSchema(require('../../../../../definitions/3.0.0/specificationExtension.json'))
.compile(infoJsonSchema);

describe('License', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ const ajv = new Ajv({
});
addFormats(ajv);

const infoJsonSchema = require('../../../../definitions/3.0.0/Reference.json');
const infoJsonSchema = require('../../../../../definitions/3.0.0/Reference.json');
const validator = ajv
.addMetaSchema(require('../../../../definitions/3.0.0/schema.json'))
.addMetaSchema(require('../../../../definitions/3.0.0/ReferenceObject.json'))
.addMetaSchema(require('../../../../../definitions/3.0.0/schema.json'))
.addMetaSchema(require('../../../../../definitions/3.0.0/ReferenceObject.json'))
.compile(infoJsonSchema);

describe('ReferenceObject', () => {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ const ajv = new Ajv({
});
addFormats(ajv);

const infoJsonSchema = require('../../../../definitions/3.0.0/Reference.json');
const infoJsonSchema = require('../../../../../definitions/3.0.0/Reference.json');
const validator = ajv
.addMetaSchema(require('../../../../definitions/3.0.0/schema.json'))
.addSchema(require('../../../../definitions/3.0.0/ReferenceObject.json'))
.addMetaSchema(require('../../../../../definitions/3.0.0/schema.json'))
.addSchema(require('../../../../../definitions/3.0.0/ReferenceObject.json'))
.compile(infoJsonSchema);

describe('Reference', () => {
Expand Down
10 changes: 2 additions & 8 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,8 @@ const fs = require('fs');
const path = require('path');

describe('AsyncAPI: 3.0.0', () => {
require('./definitions/3.0.0/info/info.js');
require('./definitions/3.0.0/info extensions/info-extension.js');
require('./definitions/3.0.0/contact/contact.js');
require('./definitions/3.0.0/license/license.js');
require('./definitions/3.0.0/reference/reference.js');
require('./definitions/3.0.0/reference object/reference-object.js');

require('./definitions/3.0.0/security/index.js');
require('./definitions/3.0.0/models');
require('./definitions/3.0.0/security');
});

describe('AsyncAPI', () => {
Expand Down

0 comments on commit 0b248c9

Please sign in to comment.