Skip to content

Commit 39461ee

Browse files
committed
ci before test
1 parent 515cdc8 commit 39461ee

File tree

2 files changed

+20
-7
lines changed

2 files changed

+20
-7
lines changed
Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,33 @@
1+
2+
const {exec} = require( 'shelljs' );
3+
4+
//@todo use this, for now using link
5+
const runCommand = (command) => {
6+
if( command.startsWith( 'plugin-machine' ) ) {
7+
command = command.replace( 'plugin-machine', '' );
8+
}
9+
const child = exec(`node dist/index.js ${command}`, {async:true});
10+
child.stdout.on('data', function(data) {
11+
12+
});
13+
}
114
describe( 'running commands to make sure there are no errors', () => {
2-
const shell = require('shelljs');
315

416
it( 'Gets node version', () => {
5-
shell.exec('plugin-machine node -v');
17+
exec('plugin-machine node -v');
618
});
719

820
it( 'Get npm version', () => {
9-
shell.exec('plugin-machine npm -v');
21+
exec('plugin-machine npm -v');
1022
}
1123
);
1224

1325
it( 'Gets yarn version', () => {
14-
shell.exec('plugin-machine yarn -v');
26+
exec('plugin-machine yarn -v');
1527
}
1628
);
1729
it( 'Gets composer version', () => {
18-
shell.exec('plugin-machine composer --version');
30+
exec('plugin-machine composer --version');
1931
}
2032
);
2133
});

src/__TESTS__/commands/plugin.test.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
describe( 'Calling plugin commands to check for errors', () => {
2-
const shell = require('shelljs');
2+
const {exec} = require('shelljs');
33
beforeAll(() => {
4-
shell.exec( 'export PLUGIN_MACHINE_API_TOKEN=1234567890' );
4+
exec( 'export PLUGIN_MACHINE_API_TOKEN=1234567890' );
5+
exec( 'plugin-machine login --token=fake --ci' );
56
});
67

78
afterAll(() => {

0 commit comments

Comments
 (0)