forked from jestjs/jest
/
index.ts
30 lines (23 loc) 路 857 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
#!/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 Runtime from 'jest-runtime';
import yargs from 'yargs';
import {validateCLIOptions} from 'jest-validate';
import {deprecationEntries} from 'jest-config';
import * as args from './args';
const {version: VERSION} = require('../../package.json');
const REPL_SCRIPT = require.resolve('./repl.js');
export = function() {
const argv = yargs.usage(args.usage).options(args.options).argv;
// @ts-ignore: not the same arguments
validateCLIOptions(argv, {...args.options, deprecationEntries});
argv._ = [REPL_SCRIPT];
// @ts-ignore: not the same arguments
Runtime.runCLI(argv, [`Jest REPL v${VERSION}`]);
};