Skip to content

Commit

Permalink
chore: use egg-mock/register instead of egg-mock/lib/parallel/agent_r…
Browse files Browse the repository at this point in the history
…egister
  • Loading branch information
killagu committed Jan 9, 2023
1 parent 8a7c04b commit e02618f
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions lib/cmd/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,12 +132,10 @@ class TestCommand extends Command {
// clean mocha stack, inspired by https://github.com/rstacruz/mocha-clean
// [mocha built-in](https://github.com/mochajs/mocha/blob/master/lib/utils.js#L738) don't work with `[npminstall](https://github.com/cnpm/npminstall)`, so we will override it.
if (!testArgv.fullTrace) requireArr.unshift(require.resolve('../mocha-clean'));
if (testArgv.parallel && testArgv['auto-agent']) {
try {
requireArr.push(require.resolve('egg-mock/lib/parallel/agent_register'));
} catch (_) {
console.warn('Please install egg-mock, or can not use auto agent');
}
try {
requireArr.push(require.resolve('egg-mock/register'));
} catch (_) {
// ...
}
// handle mochawesome enable
if (!testArgv.reporter && testArgv.mochawesome) {
Expand Down

0 comments on commit e02618f

Please sign in to comment.