Skip to content

Commit 129c199

Browse files
committed
fix: add tests for hasExternalMediaLibrary()
1 parent 3d45884 commit 129c199

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

src/generate.spec.ts

+13-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { loadConfig } from "./input";
2-
import { generateTypes } from "./generate";
2+
import { generateTypes, hasExternalMediaLibrary } from "./generate";
33

44
describe("Output testing", () => {
55
it("should parse kitchen sink correctly", () => {
@@ -34,3 +34,15 @@ describe("Output testing", () => {
3434
).toMatchSnapshot();
3535
});
3636
});
37+
38+
describe("hasExternalMediaLibrary()", () => {
39+
it("should return false if no media_library defined", () => {
40+
expect(hasExternalMediaLibrary({ collections: [] })).toBe(false);
41+
});
42+
43+
it("should return true if media_library defined", () => {
44+
expect(
45+
hasExternalMediaLibrary({ collections: [], media_library: { name: "test", config: {} } }),
46+
).toBe(true);
47+
});
48+
});

0 commit comments

Comments
 (0)