Skip to content

Commit 1f49b82

Browse files
committed
fix: change test file
1 parent 452b510 commit 1f49b82

File tree

4 files changed

+29
-17
lines changed

4 files changed

+29
-17
lines changed

src/deploy/deploy.test.js

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,12 @@
44

55
process.env.MICRO_APP_TEST = 'true';
66

7-
const path = require('path');
8-
97
describe('Command deploy', () => {
108

119
it('deploy', async () => {
1210

1311
const { service } = require('@micro-app/cli');
1412

15-
service.registerPlugin({
16-
id: 'test:DeployCommand',
17-
link: path.join(__dirname, './index.js'),
18-
});
19-
2013
const result = await service.run('deploy');
2114
console.log(result);
2215
});

src/index.test.js

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,17 @@
22

33
/* global expect */
44

5-
const MicroApp = require('@micro-app/core');
6-
const Service = MicroApp.Service;
7-
const path = require('path');
85

96
describe('Plugin DeployCommand', () => {
107

11-
it('DeployCommand', () => {
12-
const service = new Service();
13-
service.registerPlugin({
14-
id: 'test:DeployCommand',
15-
link: path.join(__dirname, './index.js'),
16-
});
8+
it('release', async () => {
9+
const { service } = require('@micro-app/cli');
10+
await service.run('help', { _: [ 'release' ] });
11+
});
1712

18-
service.run('help', { _: [] });
13+
it('deploy', async () => {
14+
const { service } = require('@micro-app/cli');
15+
await service.run('help', { _: [ 'deploy' ] });
1916
});
2017

2118
});

src/release/index.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,11 @@ Examples:
5050

5151
let chain = Promise.resolve();
5252

53+
if (process.env.MICRO_APP_TEST) {
54+
api.logger.debug('MICRO_APP_TEST --> Exit!!!');
55+
return chain;
56+
}
57+
5358
chain = chain.then(() => api.applyPluginHooks('beforeCommandRelease', { args }));
5459

5560
chain = chain.then(() => {

src/release/release.test.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
'use strict';
2+
3+
/* global expect */
4+
5+
process.env.MICRO_APP_TEST = 'true';
6+
7+
describe('Command release', () => {
8+
9+
it('release', async () => {
10+
11+
const { service } = require('@micro-app/cli');
12+
13+
const result = await service.run('release');
14+
console.log(result);
15+
});
16+
17+
});

0 commit comments

Comments
 (0)