Skip to content

Commit b6e3bf9

Browse files
committed
test(unit-jest): getSampleSchema should handle yaml
1 parent e37c737 commit b6e3bf9

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

test/unit/core/utils.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1558,6 +1558,22 @@ describe("utils", () => {
15581558
const actual = JSON.parse(res)
15591559
expect(actual.test).toEqual(123)
15601560
})
1561+
1562+
it("should return yaml example if yaml is contained in the content-type", () => {
1563+
const res = getSampleSchema({
1564+
type: "object",
1565+
}, "text/yaml", {}, {test: 123})
1566+
1567+
expect(res).toEqual("test: 123")
1568+
})
1569+
1570+
it("should return yaml example if yml is contained in the content-type", () => {
1571+
const res = getSampleSchema({
1572+
type: "object",
1573+
}, "text/yml", {}, {test: 123})
1574+
1575+
expect(res).toEqual("test: 123")
1576+
})
15611577
})
15621578

15631579
describe("paramToIdentifier", () => {

0 commit comments

Comments
 (0)