We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ef17461 commit 9705397Copy full SHA for 9705397
src/core/createMediaType.test.ts
@@ -0,0 +1,21 @@
1
+import { describe, expect, it } from "@jest/globals";
2
+import createMediaType from "./createMediaType";
3
+import type { SchemaObject } from "@omer-x/openapi-types/schema";
4
+
5
+describe("createMediaType", () => {
6
+ const mockSchema: SchemaObject = { type: "string" };
7
+ const mockExample = "example text";
8
9
+ it("should create a MediaTypeObject with only the schema", () => {
10
+ expect(createMediaType(mockSchema)).toStrictEqual({
11
+ schema: mockSchema,
12
+ });
13
14
15
+ it("should create a MediaTypeObject with schema and example when example is provided", () => {
16
+ expect(createMediaType(mockSchema, mockExample)).toStrictEqual({
17
18
+ example: mockExample,
19
20
21
+});
0 commit comments