Skip to content
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

Fix ava testing for Typescript templates #39

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

gfargo
Copy link

@gfargo gfargo commented Nov 1, 2024

These changes have resolved issues with out-of-box testing with the Typescript ink starter, mentioned in #37.

Upgrade `ava` to v6.2.0 and `ink-testing-library` to v4.0.0. Add `@ava/typescript` and `@types/node` to enhance TypeScript support. Adjust `ava` configuration to use `ts-node/register` and refine TypeScript path handling. These changes improve testing capabilities and maintain compatibility with the latest TypeScript features.
Introduce `pretest` script to run `npm run build` before tests. This ensures the code is compiled before testing, preventing runtime errors due to missing build artifacts. This change improves the reliability of the testing process by guaranteeing that the latest code is always tested.
Relocate `test.tsx` to the `source` directory to resolve broken Ava tests. The file was previously misplaced, causing test failures. This change ensures that the test file is correctly located, allowing the test suite to run without issues. No changes were made to the file's contents.

Relates to vadimdemedes#34
@sindresorhus
Copy link
Collaborator

I think it would be better to use tsx or tsimp.

@sindresorhus
Copy link
Collaborator

Add @ava/typescript

This is an alternative to something like ts-node. So it's wrong to use both.

@sindresorhus
Copy link
Collaborator

CI is failing

@gfargo
Copy link
Author

gfargo commented Nov 3, 2024

Add @ava/typescript

This is an alternative to something like ts-node. So it's wrong to use both.

This approach is mentioned here, but noticing the current ava recipe on gitub mentions using tsimp. [docs]

I'll take another look this afternoon and see how things look when switching over.

CI is failing because of unicorn eslint rules e.g.

Rule: "unicorn/expiring-todo-comments"

This is the same issue being reported by others in issues like #37

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants