forked from jestjs/jest
/
index.ts
31 lines (24 loc) 路 902 Bytes
/
index.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/usr/bin/env node
/**
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*/
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 REPL_SCRIPT = path.resolve(__dirname, './repl.js');
exports = function() {
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
Runtime.runCLI(argv, [`Jest REPL v${VERSION}`]);
};