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

[WIP] Migrate jest-repl to typescript #8000

Merged
merged 9 commits into from Feb 27, 2019

Conversation

natealcedo
Copy link
Contributor

This PR migrates jest-repl to typescript.

Notes:

  1. I have one ts-ignore in index.ts
  2. Importing package.json outside of the rootDir causes the compiler to fail

Copy link
Contributor Author

@natealcedo natealcedo left a comment

Choose a reason for hiding this comment

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

Just some things I could use some help with

*/

import Runtime from 'jest-runtime';

export const usage = 'Usage: $0 [--config=<pathToConfigFile>]';

export const options = {
...Runtime.getCLIOptions(),
export const options = Object.assign({}, Runtime.getCLIOptions(), {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Doing this gets a better type.

const argv = yargs.usage(args.usage).options(args.options).argv;

validateCLIOptions(argv, {...args.options, deprecationEntries});

argv._ = [REPL_SCRIPT];

//@ts-ignore Get feedback first in PR
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 compiler complains that argv has some keys missing. Not sure how to resolve this at the moment.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, the argv typing is not really where it should be. this is fine for now 🙂

packages/jest-repl/src/cli/repl.ts Show resolved Hide resolved
packages/jest-repl/src/cli/repl.ts Outdated Show resolved Hide resolved
packages/jest-repl/src/cli/repl.ts Outdated Show resolved Hide resolved
@natealcedo natealcedo marked this pull request as ready for review February 27, 2019 13:18
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.

This is great 😀 Could you update the changelog?

@natealcedo
Copy link
Contributor Author

Sure thing about the changelog. Was just opening the PR early to get the ball rolling.

@natealcedo
Copy link
Contributor Author

Hmm I think I introduced a regression. All the tests are failing with the same error. hmm 😞

@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 May 12, 2021
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.

None yet

3 participants