Skip to content

Commit

Permalink
Merge pull request #1 from Pakisan/test/extend-test-cases
Browse files Browse the repository at this point in the history
build: extended test cases
  • Loading branch information
Pakisan authored Jul 24, 2024
2 parents 56293bd + 7c909a7 commit cfab401
Show file tree
Hide file tree
Showing 164 changed files with 1,458 additions and 14,795 deletions.
59 changes: 59 additions & 0 deletions test/definitions/3.0.0/models/channel/channel parameter.test.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
import {
JsonSchemaTestSuite,
JsonSchemaTestSuiteConfig,
JsonSchemaTestSuiteData
} from '@test/definitions/base-schema-test.mjs';
import {describe} from 'vitest';

const jsonSchema = require('@definitions/3.0.0/parameter.json');

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

const data = new JsonSchemaTestSuiteData(
jsonSchema,
[
{
"description": "Id of the user.",
"default": "0e822ca6-5311-4d4c-b409-993a1820e689",
"enum": [
"0e822ca6-5311-4d4c-b409-993a1820e689",
"381f5ddc-75c6-4c21-9ec1-3919ed345be9",
"70559d88-31a5-4ef2-8c34-7fbd04057ed5",
"c6dc0047-a90d-4efa-95e3-a272282934e0"
],
"examples": [
"0e822ca6-5311-4d4c-b409-993a1820e689",
"381f5ddc-75c6-4c21-9ec1-3919ed345be9",
"70559d88-31a5-4ef2-8c34-7fbd04057ed5",
"c6dc0047-a90d-4efa-95e3-a272282934e0"
],
"location": "$message.payload#/user/id"
}
],
{},
{},
{
"x-number": 0,
"x-string": "",
"x-object": {
"property": {}
}
},
{
"x-number": 0,
"x-string": "",
"x-object": {
"property": {}
},
"ext-number": 1
}
);

describe('Channel Parameter', () => {
new JsonSchemaTestSuite(data, config).testSuite()
});
82 changes: 82 additions & 0 deletions test/definitions/3.0.0/models/channel/channel.test.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
import {
JsonSchemaTestSuite,
JsonSchemaTestSuiteConfig,
JsonSchemaTestSuiteData
} from '@test/definitions/base-schema-test.mjs';
import {describe} from 'vitest';

const jsonSchema = require('@definitions/3.0.0/channel.json');

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

const data = new JsonSchemaTestSuiteData(
jsonSchema,
[
{
"address": "users.{userId}",
"title": "Users channel",
"description": "This channel is used to exchange messages about user events.",
"messages": {
"userSignedUp": {
"$ref": "#/components/messages/userSignedUp"
},
"userCompletedOrder": {
"$ref": "#/components/messages/userCompletedOrder"
}
},
"parameters": {
"userId": {
"$ref": "#/components/parameters/userId"
}
},
"servers": [
{ "$ref": "#/servers/rabbitmqInProd" },
{ "$ref": "#/servers/rabbitmqInStaging" }
],
"bindings": {
"amqp": {
"is": "queue",
"queue": {
"exclusive": true
}
}
},
"tags": [
{
"name": "user",
"description": "User-related messages"
}
],
"externalDocs": {
"description": "Find more info here",
"url": "https://example.com"
}
}
],
{},
{},
{
"x-number": 0,
"x-string": "",
"x-object": {
"property": {}
}
},
{
"x-number": 0,
"x-string": "",
"x-object": {
"property": {}
},
"ext-number": 1
}
);

describe('Channel', () => {
new JsonSchemaTestSuite(data, config).testSuite()
});
1 change: 0 additions & 1 deletion test/definitions/3.0.0/models/channel/channel/empty.json

This file was deleted.

Loading

0 comments on commit cfab401

Please sign in to comment.