Skip to content

Commit c5a9e41

Browse files
committed
integration test
1 parent a4bf144 commit c5a9e41

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

integration-tests/worker/test/exit-reasons.test.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,30 @@ test('crash: syntax error', async (t) => {
5353
t.regex(error_message, /Unexpected token \(1:9\)$/);
5454
});
5555

56+
// https://github.com/OpenFn/kit/issues/1045
57+
test('crash: reference error', async (t) => {
58+
const attempt = {
59+
id: crypto.randomUUID(),
60+
jobs: [
61+
{
62+
name: 'x', // important!
63+
adaptor: '@openfn/language-common@latest',
64+
body: 'fn((s) => s.err.map(s => s))',
65+
},
66+
],
67+
};
68+
69+
const result = await run(attempt);
70+
71+
const { reason, error_type, error_message } = result;
72+
t.is(reason, 'fail');
73+
t.is(error_type, 'RuntimeError');
74+
t.regex(
75+
error_message,
76+
/TypeError: Cannot read properties of undefined \(reading \'map\'\)/
77+
);
78+
});
79+
5680
// https://github.com/OpenFn/kit/issues/758
5781
test('crash: job not found', async (t) => {
5882
lightning.addDataclip('x', {});

0 commit comments

Comments
 (0)