Skip to content

Commit 6ce820c

Browse files
committed
Test tasks that return different types
1 parent 0f0a688 commit 6ce820c

File tree

1 file changed

+57
-0
lines changed

1 file changed

+57
-0
lines changed
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
import { task } from "@trigger.dev/sdk/v3";
2+
3+
export const returnString = task({
4+
id: "return-string",
5+
run: async () => {
6+
return "This is a string";
7+
},
8+
});
9+
10+
export const returnNumber = task({
11+
id: "return-number",
12+
run: async () => {
13+
return 42;
14+
},
15+
});
16+
17+
export const returnTrue = task({
18+
id: "return-true",
19+
run: async () => {
20+
return true;
21+
},
22+
});
23+
24+
export const returnFalse = task({
25+
id: "return-false",
26+
run: async () => {
27+
return false;
28+
},
29+
});
30+
31+
export const returnNull = task({
32+
id: "return-null",
33+
run: async () => {
34+
return null;
35+
},
36+
});
37+
38+
export const returnUndefined = task({
39+
id: "return-undefined",
40+
run: async () => {
41+
return undefined;
42+
},
43+
});
44+
45+
export const returnObject = task({
46+
id: "return-object",
47+
run: async () => {
48+
return { key: "value" };
49+
},
50+
});
51+
52+
export const returnArray = task({
53+
id: "return-array",
54+
run: async () => {
55+
return [1, 2, 3];
56+
},
57+
});

0 commit comments

Comments
 (0)