Skip to content

Commit

Permalink
fix(tester): can't respond to the terminal input(createVitest -> `s…
Browse files Browse the repository at this point in the history
…tartVitest`)

vitest-dev/vitest#3561
  • Loading branch information
deot committed Jun 13, 2023
1 parent 4632766 commit a315940
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions packages/tester/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as path from 'node:path';
import { fileURLToPath } from 'node:url';
import type { Options } from '@deot/dev-shared';
import { Utils, Shell, Logger, Locals } from '@deot/dev-shared';
import { createVitest } from 'vitest/node';
import { startVitest } from 'vitest/node';
import fs from 'fs-extra';
import { getOptions } from './prompt';

Expand All @@ -23,7 +23,7 @@ export const run = (options: Options) => Utils.autoCatch(async () => {
}

const { cwd, workspace, packageOptionsMap, packageDirsMap } = locals;
const { coverage, packageName, watch, dryRun } = options;
const { coverage, watch, dryRun } = options;

options.packageFolderName = Locals.getPackageFolderName(options.packageName) || options.packageFolderName;
options.workspace = workspace;
Expand Down Expand Up @@ -77,12 +77,7 @@ export const run = (options: Options) => Utils.autoCatch(async () => {
options$.config = path.relative(cwd, path.resolve(dirname, '../shared.config.ts'));
}

const vitest = await createVitest('test', options$);

await vitest.start();
if (!watch) return;

Logger.log(packageName || '', '测试已通过');
await startVitest('test', [], options$);
}, {
onError: (e: any) => {
if (typeof e === 'number' && e === 1) {
Expand Down

0 comments on commit a315940

Please sign in to comment.