forked from asyncapi/spec-json-schemas
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(definitions): fix websockets tests name
- Loading branch information
Showing
4 changed files
with
44 additions
and
13 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,43 @@ | ||
import {it} from 'vitest'; | ||
import TestHelper from '@test/test-helper.mjs'; | ||
import path from 'path'; | ||
|
||
describe.each([ | ||
'0.1.0', | ||
])('WebSockets bindings v%s', async (bindingVersion) => { | ||
|
||
const channelSchema = await import(`@bindings/websockets/${bindingVersion}/channel.json`); | ||
|
||
describe('channel', () => { | ||
it(TestHelper.exampleIsValidTestName, () => TestHelper.objectIsValid( | ||
channelSchema, | ||
path.resolve(__dirname, `./${bindingVersion}/channel/example.json`), | ||
)); | ||
|
||
it(TestHelper.canBeEmptyTestName, () => TestHelper.objectIsValid( | ||
channelSchema, | ||
{} | ||
)); | ||
|
||
it(TestHelper.isValidWithoutRequiredPropertiesTestName, () => TestHelper.objectIsValid( | ||
channelSchema, | ||
path.resolve(__dirname, `./${bindingVersion}/channel/without required properties.json`), | ||
)); | ||
|
||
it(TestHelper.isValidWithOnlyRequiredPropertiesTestName, () => TestHelper.objectIsValid( | ||
channelSchema, | ||
path.resolve(__dirname, `./${bindingVersion}/channel/only required properties.json`), | ||
)); | ||
|
||
it.todo('Can be extended or not?', () => TestHelper.objectIsValid( | ||
channelSchema, | ||
path.resolve(__dirname, `./${bindingVersion}/channel/extended.json`), | ||
)); | ||
|
||
it.todo('Can be extended or not?', () => TestHelper.wronglyExtended( | ||
channelSchema, | ||
path.resolve(__dirname, `./${bindingVersion}/channel/wrongly extended.json`), | ||
)); | ||
}) | ||
|
||
}) |
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