From e70350762f76372925c3c4cdbc50e17fa40383a4 Mon Sep 17 00:00:00 2001 From: fengmk2 Date: Wed, 11 Jan 2023 09:35:49 +0800 Subject: [PATCH] fix: dont auto require egg-mock (#206) https://github.com/eggjs/egg-mock/pull/142#issuecomment-1377450602 fixed by https://github.com/eggjs/egg-mock/pull/144 --- package.json | 4 ++-- test/lib/cmd/cov.test.js | 12 ++++++++++++ test/lib/cmd/test.test.js | 2 -- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 91b6cb5b..cbf9a003 100644 --- a/package.json +++ b/package.json @@ -35,7 +35,7 @@ "ypkgfiles": "^1.6.0" }, "peerDependencies": { - "egg-mock": "^5.8.2" + "egg-mock": "^5.8.3" }, "peerDependenciesMeta": { "egg-mock": { @@ -52,7 +52,7 @@ "coffee": "^5.4.0", "cross-env": "^3.1.3", "egg": "^3.9.1", - "egg-mock": "^5.8.2", + "egg-mock": "^5.8.3", "enzyme": "^2.0.0", "esbuild-register": "^2.5.0", "eslint": "^8.16.0", diff --git a/test/lib/cmd/cov.test.js b/test/lib/cmd/cov.test.js index 56662608..31804c5e 100644 --- a/test/lib/cmd/cov.test.js +++ b/test/lib/cmd/cov.test.js @@ -179,6 +179,18 @@ describe('test/lib/cmd/cov.test.js', () => { .end(); }); + it('test parallel', () => { + mm(process.env, 'TESTS', 'test/**/*.test.js'); + return coffee.fork(eggBin, [ 'cov', '--parallel' ], { + cwd: path.join(__dirname, '../../fixtures/test-demo-app'), + }) + .debug() + .expect('stdout', /should work/) + .expect('stdout', /a\.test\.js/) + .expect('code', 0) + .end(); + }); + it('env should work', async () => { mm(process.env, 'TESTS', 'test/**/*.test.js'); return coffee.fork(eggBin, [ 'cov', '--parallel' ], { diff --git a/test/lib/cmd/test.test.js b/test/lib/cmd/test.test.js index 0c4417f6..cc8c270c 100644 --- a/test/lib/cmd/test.test.js +++ b/test/lib/cmd/test.test.js @@ -268,9 +268,7 @@ describe('test/lib/cmd/test.test.js', () => { }); }); - // fail on github action ubuntu it('test parallel', () => { - if (process.platform !== 'darwin') return; mm(process.env, 'TESTS', 'test/**/*.test.js'); return coffee.fork(eggBin, [ 'test', '--parallel' ], { cwd: path.join(__dirname, '../../fixtures/test-demo-app'),