forked from asyncapi/spec-json-schemas
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(definitions): info new tests structure
- Loading branch information
Showing
41 changed files
with
478 additions
and
410 deletions.
There are no files selected for viewing
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
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,61 @@ | ||
import {describe} from 'vitest'; | ||
import { | ||
JsonSchemaTestSuite, | ||
JsonSchemaTestSuiteConfig, | ||
JsonSchemaTestSuiteData | ||
} from '@test/definitions/base-schema-test.mjs'; | ||
|
||
const example = { | ||
"name": "AsyncApi", | ||
"url": "https://www.asyncapi.com", | ||
"email": "[email protected]" | ||
} | ||
|
||
const onlyRequiredProperties = {} | ||
|
||
const withoutRequiredProperties = {} | ||
|
||
const extended = { | ||
"name": "AsyncAPI", | ||
"url": "https://www.asyncapi.com", | ||
"email": "[email protected]", | ||
"x-number": 0, | ||
"x-string": "", | ||
"x-object": { | ||
"property": {} | ||
} | ||
} | ||
|
||
const wronglyExtended = { | ||
"name": "AsyncAPI", | ||
"url": "https://www.asyncapi.com", | ||
"email": "[email protected]", | ||
"x-number": 0, | ||
"x-string": "", | ||
"x-object": { | ||
"property" : { } | ||
}, | ||
"ext-number": 1 | ||
} | ||
|
||
const jsonSchema = require('@definitions/3.0.0/contact.json'); | ||
|
||
const config = new JsonSchemaTestSuiteConfig( | ||
false, | ||
[], | ||
true, | ||
[] | ||
); | ||
|
||
const data = new JsonSchemaTestSuiteData( | ||
jsonSchema, | ||
[example], | ||
onlyRequiredProperties, | ||
withoutRequiredProperties, | ||
extended, | ||
wronglyExtended | ||
); | ||
|
||
describe('Contact', () => { | ||
new JsonSchemaTestSuite(data, config).testSuite() | ||
}); |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
1 change: 0 additions & 1 deletion
1
test/definitions/3.0.0/models/info/contact/only required properties.json
This file was deleted.
Oops, something went wrong.
1 change: 0 additions & 1 deletion
1
test/definitions/3.0.0/models/info/contact/without required properties.json
This file was deleted.
Oops, something went wrong.
11 changes: 0 additions & 11 deletions
11
test/definitions/3.0.0/models/info/contact/wrongly extended.json
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
58 changes: 58 additions & 0 deletions
58
test/definitions/3.0.0/models/info/info extensions.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,58 @@ | ||
import {describe} from 'vitest'; | ||
import { | ||
JsonSchemaTestSuite, | ||
JsonSchemaTestSuiteConfig, | ||
JsonSchemaTestSuiteData | ||
} from '@test/definitions/base-schema-test.mjs'; | ||
|
||
const example = { | ||
"x-x": "PBodiachevskii", | ||
"x-linkedin": "https://www.linkedin.com/company/asyncapi/" | ||
} | ||
|
||
const onlyRequiredProperties = {} | ||
|
||
const withoutRequiredProperties = {} | ||
|
||
const extended = { | ||
"x-number" : 0, | ||
"x-string" : "", | ||
"x-object" : { | ||
"property" : { } | ||
}, | ||
"x-x": "PBodiachevskii", | ||
"x-linkedin": "https://www.linkedin.com/company/asyncapi/" | ||
} | ||
|
||
const wronglyExtended = { | ||
"ext-number": 1, | ||
"x-number": 0, | ||
"x-string": "", | ||
"x-object": { | ||
"property": {} | ||
}, | ||
"x-x": "PBodiachevskii", | ||
"x-linkedin": "https://www.linkedin.com/company/asyncapi/" | ||
} | ||
|
||
const jsonSchema = require('@definitions/3.0.0/infoExtensions.json'); | ||
|
||
const config = new JsonSchemaTestSuiteConfig( | ||
false, | ||
[], | ||
false, | ||
[] | ||
); | ||
|
||
const data = new JsonSchemaTestSuiteData( | ||
jsonSchema, | ||
[example], | ||
onlyRequiredProperties, | ||
withoutRequiredProperties, | ||
extended, | ||
wronglyExtended | ||
); | ||
|
||
describe('Info Extensions', () => { | ||
new JsonSchemaTestSuite(data, config).testSuite() | ||
}); |
This file was deleted.
Oops, something went wrong.
4 changes: 0 additions & 4 deletions
4
test/definitions/3.0.0/models/info/info extensions/example.json
This file was deleted.
Oops, something went wrong.
9 changes: 0 additions & 9 deletions
9
test/definitions/3.0.0/models/info/info extensions/extended.json
This file was deleted.
Oops, something went wrong.
37 changes: 0 additions & 37 deletions
37
test/definitions/3.0.0/models/info/info extensions/index.mjs
This file was deleted.
Oops, something went wrong.
1 change: 0 additions & 1 deletion
1
test/definitions/3.0.0/models/info/info extensions/only required properties.json
This file was deleted.
Oops, something went wrong.
1 change: 0 additions & 1 deletion
1
test/definitions/3.0.0/models/info/info extensions/without required properties.json
This file was deleted.
Oops, something went wrong.
10 changes: 0 additions & 10 deletions
10
test/definitions/3.0.0/models/info/info extensions/wrongly extended.json
This file was deleted.
Oops, something went wrong.
3 changes: 1 addition & 2 deletions
3
...0/models/info/info/properties/contact.mjs → ...0/models/info/info properties/contact.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
3 changes: 1 addition & 2 deletions
3
...dels/info/info/properties/description.mjs → ...dels/info/info properties/description.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
3 changes: 1 addition & 2 deletions
3
...els/info/info/properties/externalDocs.mjs → ...els/info/info properties/externalDocs.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
3 changes: 1 addition & 2 deletions
3
...0/models/info/info/properties/license.mjs → ...0/models/info/info properties/license.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
3 changes: 1 addition & 2 deletions
3
....0.0/models/info/info/properties/tags.mjs → ....0.0/models/info/info properties/tags.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
3 changes: 1 addition & 2 deletions
3
...s/info/info/properties/termsOfService.mjs → ...s/info/info properties/termsOfService.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
Oops, something went wrong.