Skip to content

Commit ae259da

Browse files
committed
add integration test
1 parent 6bd4210 commit ae259da

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
This is a suite of examples of jobs.
22

3-
We don't really have a place where we can just write and test arbtirary job code with compilation.
3+
We don't really have a place where we can just write and test arbitrary job code with compilation.
44

55
You can do it through the CLI or worker but they have significant overheads.

integration-tests/execute/test/execute.test.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,18 @@ test.serial('should return state', async (t) => {
2020
t.deepEqual(state, result);
2121
});
2222

23+
test.serial('allow export statements and functions', async (t) => {
24+
const state = {};
25+
26+
const job = `
27+
export const x = () => ({ x: 90 })
28+
fn(() => x())
29+
`;
30+
const result = await execute(job, state);
31+
32+
t.deepEqual(result, { x: 90 });
33+
});
34+
2335
test.serial('should use .then()', async (t) => {
2436
const state = { data: { x: 1 } };
2537

0 commit comments

Comments
 (0)