Skip to content

Commit 417fc2c

Browse files
committed
chore: alias support
1 parent 5ae38c8 commit 417fc2c

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/index.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,23 @@
11
import { runCLI } from 'jest';
22

3+
const ALIAS = {
4+
t: 'testNamePattern',
5+
w: 'maxWorkers',
6+
u: 'updateSnapshot',
7+
};
8+
39
export default function (originOpts: any = {}) {
410
const opts = { ...originOpts };
511
const cwd = process.cwd();
612

13+
// Fill jest alias
14+
Object.keys(ALIAS).forEach((key) => {
15+
if (opts[key]) {
16+
opts[ALIAS[key]] = opts[key];
17+
delete opts[key];
18+
}
19+
});
20+
721
const config = {
822
rootDir: process.cwd(),
923
testEnvironment: 'jsdom',

0 commit comments

Comments
 (0)