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

Run jest's tests in the e2e tests #12202

Merged
merged 13 commits into from Oct 16, 2020
Merged

Conversation

nicolo-ribaudo
Copy link
Member

@nicolo-ribaudo nicolo-ribaudo commented Oct 16, 2020

Q                       A
Tests Added + Pass? Yes
Documentation PR Link
Any Dependency Changes?
License MIT

I looked at jest's build process and I think that they use tsc to build .d.ts files, but Babel to compile .ts files to .js (@SimenB is this correct?).

Since apparently we have some missing TS coverage, this would help preventing future regressions in real-world code.

@nicolo-ribaudo nicolo-ribaudo added area: tests PR: Internal 🏠 A type of pull request used for our changelog categories labels Oct 16, 2020
@babel-bot
Copy link
Collaborator

babel-bot commented Oct 16, 2020

Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/30394/

@codesandbox-ci
Copy link

codesandbox-ci bot commented Oct 16, 2020

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 1e40b57:

Sandbox Source
babel-repl-custom-plugin Configuration
babel-plugin-multi-config Configuration

@existentialism existentialism changed the title Run jest't tests in the e2e tests Run jest's tests in the e2e tests Oct 16, 2020
@nicolo-ribaudo
Copy link
Member Author

I'm not sure why tsc is failing to type-check, but it doesn't seem related to Babel 🤔
I'm disabling it for now.

https://app.circleci.com/pipelines/github/babel/babel/4204/workflows/e43fd27e-067b-49ce-bc4c-43293ee44207/jobs/30322

@SimenB
Copy link
Contributor

SimenB commented Oct 16, 2020

I looked at jest's build process and I think that they use tsc to build .d.ts files, but Babel to compile .ts files to .js (@SimenB is this correct?).

Yep!

@SimenB
Copy link
Contributor

SimenB commented Oct 16, 2020

Type error seems to be due to some mismatch between @babel/types that jest depends on and what's available?

@nicolo-ribaudo
Copy link
Member Author

Type error seems to be due to some mismatch between @babel/types that jest depends on and what's available?

Thanks! I've fixed it now.

Co-authored-by: Huáng Jùnliàng <jlhwung@gmail.com>
bumped = true;
}
}
}

if ("peerDependencies" in content) {
bumpBabelDependency(content.peerDependencies);
bumpBabelDependency(content.peerDependencies, "*");
Copy link
Member Author

Choose a reason for hiding this comment

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

This is because yarn was throwing for latest in the peerDependencies

Copy link
Contributor

Choose a reason for hiding this comment

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

Or we can simply remove peerDependencies 😈.

Copy link
Member Author

Choose a reason for hiding this comment

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

It will cause problems if one of the packages we test starts using PnP 😛

@nicolo-ribaudo
Copy link
Member Author

Ok this is ready 🎉

Copy link
Member

@existentialism existentialism left a comment

Choose a reason for hiding this comment

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

moar tests!

@nicolo-ribaudo nicolo-ribaudo merged commit 63567f0 into babel:main Oct 16, 2020
@nicolo-ribaudo nicolo-ribaudo deleted the e2e-jest branch October 16, 2020 21:19
Comment on lines +50 to +52
CI=true yarn test-ci-partial packages
CI=true yarn test-ci-partial e2e/__tests__/babel
CI=true yarn test-ci-partial e2e/__tests__/transform
Copy link
Contributor

@SimenB SimenB Oct 20, 2020

Choose a reason for hiding this comment

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

Could do yarn test-ci-partial --ci packages e2e/__tests__/babel e2e/__tests__/transform?

FWIW I just landed jestjs/jest#10653 which adds test-ci-partial:parallel (which just removes the -i argument) so if you have multiple cores available on CI you can speed it up.

yarn test-ci-partial:parallel --ci --max-workers $(nproc) packages e2e/__tests__/babel e2e/__tests__/transform or something like that

@github-actions github-actions bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label Jan 20, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 20, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: tests outdated A closed issue/PR that is archived due to age. Recommended to make a new issue PR: Internal 🏠 A type of pull request used for our changelog categories
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants