-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.test.js
45 lines (40 loc) · 1.18 KB
/
index.test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
const promptmaker = require(".");
test("generates a prompt string", () => {
const prompt = promptmaker();
expect(typeof prompt).toBe("string");
});
test("takes an optional subject", () => {
const prompt = promptmaker({ subject: "cheese" });
expect(typeof prompt).toBe("string");
expect(prompt).toMatch(/cheese/);
});
test("takes an optional subject", () => {
const prompt = promptmaker({ subject: "cheese" });
expect(typeof prompt).toBe("string");
expect(prompt).toMatch(/cheese/);
});
test("takes lots of options", () => {
const prompt = promptmaker({
medium: "oil painting",
subject: "cheese",
movement: "american impressionism",
artist: "Anna Hotchkis",
});
expect(typeof prompt).toBe("string");
expect(prompt).toMatch(
"oil painting of cheese american impressionism by Anna Hotchkis, "
);
});
test("allows flavors to be disabled", () => {
const prompt = promptmaker({
medium: "oil painting",
subject: "cheese",
movement: "american impressionism",
artist: "Anna Hotchkis",
flavors: false,
});
expect(typeof prompt).toBe("string");
expect(prompt).toBe(
"oil painting of cheese american impressionism by Anna Hotchkis"
);
});