refactor(@vant/cli): migrate to ESM package
This commit is contained in:
@@ -1,7 +1,11 @@
|
||||
import { runCLI } from 'jest';
|
||||
import { setNodeEnv } from '../common';
|
||||
import { genPackageEntry } from '../compiler/gen-package-entry';
|
||||
import { ROOT, JEST_CONFIG_FILE, PACKAGE_ENTRY_FILE } from '../common/constant';
|
||||
import jest from 'jest';
|
||||
import { setNodeEnv } from '../common/index.js';
|
||||
import { genPackageEntry } from '../compiler/gen-package-entry.js';
|
||||
import {
|
||||
ROOT,
|
||||
JEST_CONFIG_FILE,
|
||||
PACKAGE_ENTRY_FILE,
|
||||
} from '../common/constant.js';
|
||||
|
||||
export function test(command: any) {
|
||||
setNodeEnv('test');
|
||||
@@ -13,18 +17,19 @@ export function test(command: any) {
|
||||
const config = {
|
||||
rootDir: ROOT,
|
||||
watch: command.watch,
|
||||
debug: command.debug,
|
||||
config: JEST_CONFIG_FILE,
|
||||
runInBand: command.runInBand,
|
||||
clearCache: command.clearCache,
|
||||
changedSince: command.changedSince,
|
||||
logHeapUsage: command.logHeapUsage,
|
||||
runInBand: command.runInBand,
|
||||
debug: command.debug,
|
||||
// make jest tests faster
|
||||
// see: https://ivantanev.com/make-jest-faster/
|
||||
maxWorkers: '50%',
|
||||
} as any;
|
||||
|
||||
runCLI(config, [ROOT])
|
||||
jest
|
||||
.runCLI(config, [ROOT])
|
||||
.then((response) => {
|
||||
if (!response.results.success && !command.watch) {
|
||||
process.exit(1);
|
||||
|
||||
Reference in New Issue
Block a user