Skip to content

Commit 88db493

Browse files
committed
test: tail call
1 parent e1ea023 commit 88db493

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

test/index.test.ts

+12
Original file line numberDiff line numberDiff line change
@@ -159,3 +159,15 @@ it('yield generator', async () => {
159159
expect(multiply.sync()).toBe('strstr')
160160
await expect(multiply.async()).resolves.toBe('strstr')
161161
})
162+
163+
it('handles tail call', async () => {
164+
const echo = quansync({
165+
sync: (v: string) => v,
166+
async: v => Promise.resolve(v),
167+
})
168+
const produce = quansync(() => echo('hello'))
169+
170+
await expect(produce()).resolves.toBe('hello')
171+
await expect(produce.async()).resolves.toBe('hello')
172+
expect(produce.sync()).toBe('hello')
173+
})

0 commit comments

Comments
 (0)