Skip to content

Commit

Permalink
test(definitions): fix websockets tests name
Browse files Browse the repository at this point in the history
  • Loading branch information
Pakisan committed Jun 14, 2024
1 parent a309199 commit 2598143
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 13 deletions.
5 changes: 0 additions & 5 deletions test/bindings/bindings.suite.mjs

This file was deleted.

7 changes: 0 additions & 7 deletions test/bindings/websockets/index.mjs

This file was deleted.

43 changes: 43 additions & 0 deletions test/bindings/websockets/websockets.test.mjs
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`),
));
})

})
2 changes: 1 addition & 1 deletion vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ export default defineConfig({
'**/test/schemas.mjs',
'**/test/bundler.mjs',
'**/test/index.test.mjs',
'**/test/bindings/bindings.suite.mjs',
'**/test/bindings/amqp/amqp.test.mjs',
'**/test/bindings/anypointmq/anypointmq.test.mjs',
'**/test/bindings/googlepubsub/googlepubsub.test.mjs',
Expand All @@ -24,6 +23,7 @@ export default defineConfig({
'**/test/bindings/sns/sns.test.mjs',
'**/test/bindings/solace/solace.test.mjs',
'**/test/bindings/sqs/sqs.test.mjs',
'**/test/bindings/websockets/websockets.test.mjs',
'**/test/definitions/3.0.0/definitions.suite.mjs',
],
reporters: ['verbose'] // https://vitest.dev/guide/reporters#custom-reporters
Expand Down

0 comments on commit 2598143

Please sign in to comment.