-
-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from Pakisan/test/extend-test-cases
build: extended test cases
- Loading branch information
Showing
164 changed files
with
1,458 additions
and
14,795 deletions.
There are no files selected for viewing
59 changes: 59 additions & 0 deletions
59
test/definitions/3.0.0/models/channel/channel parameter.test.mjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() | ||
}); |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.