Skip to content

Commit

Permalink
test(definitions): HTTP bindings new tests structure
Browse files Browse the repository at this point in the history
  • Loading branch information
Pakisan committed Jul 25, 2024
1 parent 374dd7a commit 4f39aa0
Show file tree
Hide file tree
Showing 33 changed files with 292 additions and 298 deletions.
13 changes: 0 additions & 13 deletions test/bindings/http/0.1.0/message/example.json

This file was deleted.

7 changes: 0 additions & 7 deletions test/bindings/http/0.1.0/message/extended.json

This file was deleted.

This file was deleted.

This file was deleted.

8 changes: 0 additions & 8 deletions test/bindings/http/0.1.0/message/wrongly extended.json

This file was deleted.

18 changes: 0 additions & 18 deletions test/bindings/http/0.1.0/operation/example.json

This file was deleted.

9 changes: 0 additions & 9 deletions test/bindings/http/0.1.0/operation/extended.json

This file was deleted.

This file was deleted.

This file was deleted.

10 changes: 0 additions & 10 deletions test/bindings/http/0.1.0/operation/wrongly extended.json

This file was deleted.

13 changes: 0 additions & 13 deletions test/bindings/http/0.2.0/message/example.json

This file was deleted.

7 changes: 0 additions & 7 deletions test/bindings/http/0.2.0/message/extended.json

This file was deleted.

This file was deleted.

This file was deleted.

8 changes: 0 additions & 8 deletions test/bindings/http/0.2.0/message/wrongly extended.json

This file was deleted.

17 changes: 0 additions & 17 deletions test/bindings/http/0.2.0/operation/example.json

This file was deleted.

7 changes: 0 additions & 7 deletions test/bindings/http/0.2.0/operation/extended.json

This file was deleted.

This file was deleted.

This file was deleted.

8 changes: 0 additions & 8 deletions test/bindings/http/0.2.0/operation/wrongly extended.json

This file was deleted.

14 changes: 0 additions & 14 deletions test/bindings/http/0.3.0/message/example.json

This file was deleted.

7 changes: 0 additions & 7 deletions test/bindings/http/0.3.0/message/extended.json

This file was deleted.

This file was deleted.

This file was deleted.

8 changes: 0 additions & 8 deletions test/bindings/http/0.3.0/message/wrongly extended.json

This file was deleted.

17 changes: 0 additions & 17 deletions test/bindings/http/0.3.0/operation/example.json

This file was deleted.

7 changes: 0 additions & 7 deletions test/bindings/http/0.3.0/operation/extended.json

This file was deleted.

This file was deleted.

This file was deleted.

8 changes: 0 additions & 8 deletions test/bindings/http/0.3.0/operation/wrongly extended.json

This file was deleted.

130 changes: 130 additions & 0 deletions test/bindings/http/http message binding.test.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
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/http/0.1.0/message.json`),
[
{
"headers": {
"type": "object",
"properties": {
"Content-Type": {
"type": "string",
"enum": [
"application/json"
]
}
}
}
}
],
{},
{},
{
"x-number": 0,
"x-string": "",
"x-object": {
"property": {}
}
},
{
"x-number": 0,
"x-string": "",
"x-object": {
"property": {}
},
"ext-number": 1
}
),
"0.2.0": new JsonSchemaTestSuiteData(
require(`@bindings/http/0.2.0/message.json`),
[
{
"headers": {
"type": "object",
"properties": {
"Content-Type": {
"type": "string",
"enum": [
"application/json"
]
}
}
}
}
],
{},
{},
{
"x-number": 0,
"x-string": "",
"x-object": {
"property": {}
}
},
{
"x-number": 0,
"x-string": "",
"x-object": {
"property": {}
},
"ext-number": 1
}
),
"0.3.0": new JsonSchemaTestSuiteData(
require(`@bindings/http/0.3.0/message.json`),
[
{
"headers": {
"type": "object",
"properties": {
"Content-Type": {
"type": "string",
"enum": [
"application/json"
]
}
}
},
"statusCode": 200
}
],
{},
{},
{
"x-number": 0,
"x-string": "",
"x-object": {
"property": {}
}
},
{
"x-number": 0,
"x-string": "",
"x-object": {
"property": {}
},
"ext-number": 1
}
)
}

describe.each([
'0.1.0',
'0.2.0',
'0.3.0',
])('HTTP message binding v%s', (bindingVersion) => {
new JsonSchemaTestSuite(data[bindingVersion], config[bindingVersion]).testSuite()
})
Loading

0 comments on commit 4f39aa0

Please sign in to comment.