-
-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(definitions): Models Test Suite
- Loading branch information
Showing
23 changed files
with
79 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
import {describe} from 'vitest'; | ||
|
||
describe('AsyncAPI 3.0.0 Test Suite', async () => { | ||
await import('./models/index.mjs'); | ||
await import('./security/index.mjs'); | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
import {describe, test} from 'vitest'; | ||
import {describe} from 'vitest'; | ||
|
||
describe('Channel test suite', () => { | ||
test('Channel', require('./channel')); | ||
test('Message', require('./message')); | ||
test('Parameter', require('./parameter')); | ||
describe('Channel Test Suite', async () => { | ||
await import('./channel'); | ||
await import('./message'); | ||
await import('./parameter'); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
import {describe, test} from 'vitest'; | ||
import {describe} from 'vitest'; | ||
|
||
describe('Message test suite', () => { | ||
test('Correlation Id', require('./correlationId')); | ||
test('Message', require('./message')); | ||
test('Message Example', require('./messageExample')); | ||
test('Message Trait', require('./messageTrait')); | ||
describe('Message Test Suite', async () => { | ||
await import('./correlationId'); | ||
await import('./message'); | ||
await import('./messageExample'); | ||
await import('./messageTrait'); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import {describe} from 'vitest'; | ||
|
||
describe('Models Test Suite', async () => { | ||
await import('./channel'); | ||
await import('./info'); | ||
await import('./operation'); | ||
await import('./reference'); | ||
await import('./server'); | ||
await import('./tag'); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
import {describe} from 'vitest'; | ||
|
||
describe('Info Test Suite', () => { | ||
test('Info', require('./info')); | ||
test('Info Extensions', require('./info extensions')); | ||
test('Contact', require('./contact')); | ||
test('License', require('./license')); | ||
describe('Info Test Suite', async () => { | ||
await import('./info'); | ||
await import('./info extensions'); | ||
await import('./contact'); | ||
await import('./license'); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
import {describe} from 'vitest'; | ||
|
||
describe('Operation test suite', () => { | ||
test('Operation', require('./operation')); | ||
test('Operation Reply', require('./operationReply')); | ||
test('Operation Reply Address', require('./operationReplyAddress')); | ||
test('Operation Operation Trait', require('./operationTrait')); | ||
describe('Operation Test Suite', async () => { | ||
await import('./operation'); | ||
await import('./operationReply'); | ||
await import('./operationReplyAddress'); | ||
await import('./operationTrait'); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,6 @@ | ||
import path from 'path'; | ||
import TestHelper from '@test/test-helper.js'; | ||
import {describe} from 'vitest'; | ||
|
||
const jsonSchema = require('@definitions/3.0.0/Reference.json'); | ||
|
||
describe('Reference', () => { | ||
it('example', () => TestHelper.objectIsValid( | ||
jsonSchema, | ||
path.resolve(__dirname, './example.json'), | ||
)); | ||
|
||
it('empty', () => TestHelper.objectIsNotValid( | ||
jsonSchema, | ||
path.resolve(__dirname, './empty.json'), | ||
['must have required property \'$ref\''] | ||
)); | ||
|
||
it('without required properties', () => TestHelper.objectIsNotValid( | ||
jsonSchema, | ||
path.resolve(__dirname, './without required properties.json'), | ||
['must have required property \'$ref\''] | ||
)); | ||
|
||
it('only required properties', () => () => TestHelper.objectIsValid( | ||
jsonSchema, | ||
path.resolve(__dirname, './only required properties.json.json'), | ||
)); | ||
|
||
it.skip('extended. Reason: schema doesn\'t check for extensions', () => TestHelper.objectIsValid( | ||
jsonSchema, | ||
path.resolve(__dirname, '../../../extended.json') | ||
)); | ||
|
||
it.skip('wrongly extended. Reason: schema doesn\'t check for extensions', () => TestHelper.wronglyExtended( | ||
jsonSchema, | ||
path.resolve(__dirname, '../../../../wrongly extended.json') | ||
)); | ||
}); | ||
describe('Reference Test Suite', async () => { | ||
await import('./reference'); | ||
await import('./reference object'); | ||
}); |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
38 changes: 38 additions & 0 deletions
38
test/definitions/3.0.0/models/reference/reference/index.mjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import path from 'path'; | ||
import TestHelper from '@test/test-helper.js'; | ||
|
||
const jsonSchema = require('@definitions/3.0.0/Reference.json'); | ||
|
||
describe('Reference', () => { | ||
it('example', () => TestHelper.objectIsValid( | ||
jsonSchema, | ||
path.resolve(__dirname, './example.json'), | ||
)); | ||
|
||
it('empty', () => TestHelper.objectIsNotValid( | ||
jsonSchema, | ||
path.resolve(__dirname, './empty.json'), | ||
['must have required property \'$ref\''] | ||
)); | ||
|
||
it('without required properties', () => TestHelper.objectIsNotValid( | ||
jsonSchema, | ||
path.resolve(__dirname, './without required properties.json'), | ||
['must have required property \'$ref\''] | ||
)); | ||
|
||
it('only required properties', () => () => TestHelper.objectIsValid( | ||
jsonSchema, | ||
path.resolve(__dirname, './only required properties.json.json'), | ||
)); | ||
|
||
it.skip('extended. Reason: schema doesn\'t check for extensions', () => TestHelper.objectIsValid( | ||
jsonSchema, | ||
path.resolve(__dirname, '../../../extended.json') | ||
)); | ||
|
||
it.skip('wrongly extended. Reason: schema doesn\'t check for extensions', () => TestHelper.wronglyExtended( | ||
jsonSchema, | ||
path.resolve(__dirname, '../../../../wrongly extended.json') | ||
)); | ||
}); |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
import {describe, it} from 'vitest'; | ||
import {describe} from 'vitest'; | ||
|
||
describe('Server test suite', () => { | ||
it('Server', () => require('./server')); | ||
it('Server Variable', () => require('./serverVariable')); | ||
describe('Server Test Suite', async () => { | ||
await import('./server'); | ||
await import('./serverVariable'); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters