Skip to content

Commit

Permalink
test(definitions): WebSockets bindings new tests structure
Browse files Browse the repository at this point in the history
  • Loading branch information
Pakisan committed Jul 26, 2024
1 parent 077e01a commit 37503ab
Show file tree
Hide file tree
Showing 7 changed files with 65 additions and 81 deletions.
21 changes: 0 additions & 21 deletions test/bindings/websockets/0.1.0/channel/example.json

This file was deleted.

7 changes: 0 additions & 7 deletions test/bindings/websockets/0.1.0/channel/extended.json

This file was deleted.

This file was deleted.

This file was deleted.

8 changes: 0 additions & 8 deletions test/bindings/websockets/0.1.0/channel/wrongly extended.json

This file was deleted.

65 changes: 65 additions & 0 deletions test/bindings/websockets/websockets channel binding.test.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
import {
JsonSchemaTestSuite,
JsonSchemaTestSuiteConfig,
JsonSchemaTestSuiteData
} from '@test/definitions/base-schema-test.mjs';
import {describe} from 'vitest';

const config = new JsonSchemaTestSuiteConfig(
false,
[],
true,
[]
);

let data = {
"0.1.0": new JsonSchemaTestSuiteData(
require(`@bindings/websockets/0.1.0/channel.json`),
[
{
"method": "GET",
"query": {
"type": "object",
"properties": {
"ref": {
"type": "string",
"description": "Referral."
}
}
},
"headers": {
"type": "object",
"properties": {
"Authentication": {
"type": "string",
"description": "Authentication token"
}
}
}
}
],
{},
{},
{
"x-number": 0,
"x-string": "",
"x-object": {
"property": {}
}
},
{
"x-number": 0,
"x-string": "",
"x-object": {
"property": {}
},
"ext-number": 1
}
),
}

describe.each([
'0.1.0',
])('WebSockets channel binding v%s', (bindingVersion) => {
new JsonSchemaTestSuite(data[bindingVersion], config).testSuite()
})
43 changes: 0 additions & 43 deletions test/bindings/websockets/websockets.test.mjs

This file was deleted.

0 comments on commit 37503ab

Please sign in to comment.