File tree Expand file tree Collapse file tree 2 files changed +20
-7
lines changed
Expand file tree Collapse file tree 2 files changed +20
-7
lines changed Original file line number Diff line number Diff line change 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+ }
114describe ( '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} ) ;
Original file line number Diff line number Diff line change 11describe ( '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 ( ( ) => {
You can’t perform that action at this time.
0 commit comments