-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
Changes from 3 commits
4131492
a611b59
7a17b62
66b4944
20a0b93
f04f261
50451de
9b5182f
d9eb157
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,26 +5,28 @@ | |
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
* | ||
* @flow | ||
*/ | ||
|
||
import path from 'path'; | ||
|
||
import Runtime from 'jest-runtime'; | ||
import yargs from 'yargs'; | ||
// @ts-ignore: Wait for jest-validate to get migrated | ||
import {validateCLIOptions} from 'jest-validate'; | ||
import {deprecationEntries} from 'jest-config'; | ||
import {version as VERSION} from '../../package.json'; | ||
import * as args from './args'; | ||
|
||
const {version: VERSION} = require("../../package.json"); | ||
|
||
const REPL_SCRIPT = path.resolve(__dirname, './repl.js'); | ||
|
||
module.exports = function() { | ||
exports = function() { | ||
natealcedo marked this conversation as resolved.
Show resolved
Hide resolved
|
||
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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 🙂 |
||
Runtime.runCLI(argv, [`Jest REPL v${VERSION}`]); | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
{ | ||
"extends": "../../tsconfig.json", | ||
"compilerOptions": { | ||
"rootDir": "src", | ||
"outDir": "build", | ||
}, | ||
"references": [ | ||
{ | ||
"path": "../jest-config" | ||
}, | ||
{ | ||
"path": "../jest-runtime" | ||
}, | ||
{ | ||
"path": "../jest-transform" | ||
}, | ||
{ | ||
"path": "../jest-types" | ||
} | ||
// TODO: Wait for this to get migrated | ||
/* | ||
{ | ||
"path": "../jest-validate" | ||
} | ||
*/ | ||
] | ||
} |
There was a problem hiding this comment.
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.