Skip to content

Commit

Permalink
test(definitions): Pulsar 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 090496d commit 4f0cbf3
Show file tree
Hide file tree
Showing 13 changed files with 116 additions and 155 deletions.
15 changes: 0 additions & 15 deletions test/bindings/pulsar/0.1.0/channel/example.json

This file was deleted.

9 changes: 0 additions & 9 deletions test/bindings/pulsar/0.1.0/channel/extended.json

This file was deleted.

This file was deleted.

This file was deleted.

10 changes: 0 additions & 10 deletions test/bindings/pulsar/0.1.0/channel/wrongly extended.json

This file was deleted.

3 changes: 0 additions & 3 deletions test/bindings/pulsar/0.1.0/server/example.json

This file was deleted.

7 changes: 0 additions & 7 deletions test/bindings/pulsar/0.1.0/server/extended.json

This file was deleted.

This file was deleted.

This file was deleted.

8 changes: 0 additions & 8 deletions test/bindings/pulsar/0.1.0/server/wrongly extended.json

This file was deleted.

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

const config = new JsonSchemaTestSuiteConfig(
true,
[
'must have required property \'namespace\'',
'must have required property \'persistence\'',
],
true,
[]
);

let data = {
"0.1.0": new JsonSchemaTestSuiteData(
require(`@bindings/pulsar/0.1.0/channel.json`),
[
{
"namespace": "staging",
"persistence": "persistent",
"compaction": 1000,
"geo-replication": [
"us-east1",
"us-west1"
],
"retention": {
"time": 7,
"size": 1000
},
"ttl": 360,
"deduplication": false
}
],
{
"namespace": "staging",
"persistence": "persistent"
},
{},
{
"namespace": "staging",
"persistence": "persistent",
"x-number": 0,
"x-string": "",
"x-object": {
"property": {}
}
},
{
"namespace": "staging",
"persistence": "persistent",
"x-number": 0,
"x-string": "",
"x-object": {
"property": {}
},
"ext-number": 1
}
),
}

describe.each([
'0.1.0',
])('Pulsar channel binding v%s', (bindingVersion) => {
new JsonSchemaTestSuite(data[bindingVersion], config).testSuite()
})
47 changes: 47 additions & 0 deletions test/bindings/pulsar/pulsar server binding.test.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
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/pulsar/0.1.0/server.json`),
[
{
"tenant": "contoso"
}
],
{},
{},
{
"x-number": 0,
"x-string": "",
"x-object": {
"property": {}
}
},
{
"x-number": 0,
"x-string": "",
"x-object": {
"property": {}
},
"ext-number": 1
}
),
}

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

This file was deleted.

0 comments on commit 4f0cbf3

Please sign in to comment.