Skip to content

Commit 8399a0b

Browse files
committed
cover pets.yaml to x-types and back to schemas
1 parent 6a4df62 commit 8399a0b

File tree

4 files changed

+5363
-7
lines changed

4 files changed

+5363
-7
lines changed

applications/__tests__/e2e-bundle.test.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,17 @@ describe('bundle', () => {
7979
expect(stdout).toMatchSnapshot()
8080
})
8181

82-
test('generate x-types from JSON Schemas', () => {
83-
const {stdout} = runCommand(
82+
test('generate x-types from JSON Schemas and generate schemas back', () => {
83+
const {stdout: toXTypes} = runCommand(
8484
'redocly bundle applications/resources/pets.yaml --config=applications/generate-x-types-redocly.yaml'
8585
)
86-
expect(stdout).toMatchFileSnapshot('file-snapshots/pets-to-x-types.yaml')
86+
expect(toXTypes).toMatchFileSnapshot('file-snapshots/pets-to-x-types.yaml')
87+
const {stdout: backToSchemas} = runCommand(
88+
'redocly bundle applications/__tests__/file-snapshots/pets-to-x-types.yaml --config=applications/x-redocly.yaml'
89+
)
90+
expect(backToSchemas).toMatchFileSnapshot(
91+
'file-snapshots/pets-back-to-schemas.yaml'
92+
)
8793
})
8894

8995
test('openapi writeOnly and readOnly fields', () => {

0 commit comments

Comments
 (0)