Skip to content

Commit 1f4d293

Browse files
committed
test: change test file
1 parent 2d078c7 commit 1f4d293

File tree

3 files changed

+11
-33
lines changed

3 files changed

+11
-33
lines changed

src/index.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ module.exports = function(api, vueConfig) {
1313
const plugin = IPLUGIN_ID ? service.findPlugin(IPLUGIN_ID) : service.plugins[0]; // 随便取个plugin
1414
const _mapi = plugin[Symbol.for('api')];
1515

16+
if (!_mapi) {
17+
const { logger } = require('@micro-app/shared-utils');
18+
return logger.error('[Vue-CLI-Plugin]', 'Not Found "api"!');
19+
}
20+
1621
// 重写 resolveWebpackConfig
1722
_mapi.extendMethod('resolveWebpackConfig', {
1823
description: 'resolve webpack config.',

test/cliPlugin.spec.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,15 @@ describe('Vue CLI Plugin', () => {
88

99
it('plugin', async () => {
1010
const api = {
11+
service: {
12+
plugins: [],
13+
},
1114
chainWebpack() {
1215

1316
},
14-
service: {},
17+
extendMethod() {
18+
19+
},
1520
};
1621

1722
plugin(api, {});

test/createService.spec.js

Lines changed: 0 additions & 32 deletions
This file was deleted.

0 commit comments

Comments
 (0)