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

chore(ci): refactor ts-node compatibility tests #12834

Merged
merged 4 commits into from
May 11, 2022
Merged

chore(ci): refactor ts-node compatibility tests #12834

merged 4 commits into from
May 11, 2022

Conversation

mrazauskas
Copy link
Contributor

Spilt from #12801

44 changed files 🙈. Better to split, that’s too much for such a small change

Summary

In the mentioned PR I was trying to proof that TS configs work with ts-node. These compatibility tests needed types to be build, but that takes so long (because of "skipLibCheck": false). That’s too slow for CI.

In the other hand, types are build for type tests. Hm.. What if ts-node compatibility would be checked in the same job with type tests? Many tests can be run and there is no performance penalty.

Test plan

More compatibility tests added.

Comment on lines 8 to 10
import type {Config} from '@jest/types';

const config: Config.InitialOptions = {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here integration with ts-node is checked on different OS and Node versions, but without a need to build types.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we add some type annotations just to prove it actually does anything else than running it as JS?

Comment on lines 62 to 66
'jest.config.ts':
'import type {Config} from "@jest/types";' +
'const config: Config.InitialOptions = {displayName: "ts-esm-object-config", verbose: true};' +
'export default config;',
'package.json': '{"type": "module"}',
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The same integration check, but with types build properly. There is one difference – this check now runs only on LTS Node (the old test still checks different versions). Here integration with Jest types is checked. Probably that’s fine, because types will work similar between Node versions.

The other difference – here the types are build and bundled properly. The old test did not bundle types.

Copy link
Member

@SimenB SimenB left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good idea 👍

Copy link
Member

@SimenB SimenB left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@SimenB SimenB merged commit e0cb576 into jestjs:main May 11, 2022
@mrazauskas mrazauskas deleted the chore-ts-compatibility-job branch May 11, 2022 07:16
@github-actions
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 11, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants