forked from jestjs/jest
/
index.ts
29 lines (23 loc) 路 849 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
#!/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 yargs = require('yargs');
import type {Config} from '@jest/types';
import {deprecationEntries} from 'jest-config';
import {validateCLIOptions} from 'jest-validate';
import * as args from './args';
import {run as runtimeCLI} from './runtime-cli';
import {VERSION} from './version';
const REPL_SCRIPT = require.resolve('./repl');
export function run(): Promise<void> {
const argv = yargs.usage(args.usage).options(args.options)
.argv as Config.Argv;
validateCLIOptions(argv, {...args.options, deprecationEntries});
argv._ = [REPL_SCRIPT];
return runtimeCLI(argv, [`Jest REPL v${VERSION}`]);
}