Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Test hangs or times out on some TypeScript compilation errors. #3031

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
paulgb opened this issue May 28, 2022 · 0 comments
Closed

Test hangs or times out on some TypeScript compilation errors. #3031

paulgb opened this issue May 28, 2022 · 0 comments

Comments

@paulgb
Copy link

paulgb commented May 28, 2022

When I run this test:

import test from 'ava'

test('foobar', async (t) => {
    const foo_1 = foo()
    const foo_2 = foo()
    const foo_3 = foo()
    const foo_4 = foo()
    const foo_5 = foo()
    const foo_6 = foo()
    const foo_7 = foo()
})

Instead of reporting a compilation error, I get this:

  ✖ Timed out while running tests

If I remove one of the declarations, I get the following, as expected:

  Uncaught exception in src/test-spawn.ts

  src/test-spawn.ts(4,19): error TS2304: Cannot find name 'foo'.
  src/test-spawn.ts(5,19): error TS2304: Cannot find name 'foo'.
  src/test-spawn.ts(6,19): error TS2304: Cannot find name 'foo'.
  src/test-spawn.ts(7,19): error TS2304: Cannot find name 'foo'.
  src/test-spawn.ts(8,19): error TS2304: Cannot find name 'foo'.
  src/test-spawn.ts(9,19): error TS2304: Cannot find name 'foo'.
  

  ✖ src/test-spawn.ts exited with a non-zero exit code: 1
  ─

  1 uncaught exception

It seems there's some threshold (maybe the amount of tsc output?) that's causing ava to time out rather than report the error.

This occurs when using the ts-node/register TypeScript approach (https://github.com/avajs/ava/blob/main/docs/recipes/typescript.md#for-packages-without-type-module).

I've created a minimal reproducible example here: https://github.com/paulgb/ava-timeout-issue-repro

@avajs avajs locked and limited conversation to collaborators May 29, 2022
@novemberborn novemberborn converted this issue into discussion #3033 May 29, 2022

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Projects
None yet
Development

No branches or pull requests

1 participant