diff --git a/libraries/fabric-shim/cli.js b/libraries/fabric-shim/cli.js index ac70d53a..30f9133a 100755 --- a/libraries/fabric-shim/cli.js +++ b/libraries/fabric-shim/cli.js @@ -5,7 +5,7 @@ const Logger = require('./lib/logger'); const logger = Logger.getLogger('fabric-shim/cli'); const results = require('yargs') - .parserConfiguration({"dot-notation":false}) + .parserConfiguration({'dot-notation':false}) .commandDir('./lib/cmds') .demandCommand() .help() diff --git a/libraries/fabric-shim/test/unit/cli.js b/libraries/fabric-shim/test/unit/cli.js index c9eb4194..67b63450 100644 --- a/libraries/fabric-shim/test/unit/cli.js +++ b/libraries/fabric-shim/test/unit/cli.js @@ -20,10 +20,13 @@ const sinon = require('sinon'); const yargs = require('yargs'); +const {execSync} = require('child_process'); + describe('fabric-chaincode-node cli', () => { let sandbox; beforeEach(() => { + sandbox = sinon.createSandbox(); sandbox.stub(yargs, 'parserConfiguration').returns(yargs); sandbox.stub(yargs, 'commandDir').returns(yargs); @@ -35,11 +38,15 @@ describe('fabric-chaincode-node cli', () => { sandbox.stub(yargs, 'version').returns(yargs); sandbox.stub(process, 'exit'); + execSync('cp ./cli.js ./cli2.js', () => {}); + execSync('sed 1d ./cli2.js > ./cli.js', () => {}); }); afterEach(() => { sandbox.restore(); delete require.cache[require.resolve('../../cli.js')]; + execSync('rm ./cli.js', () => {}); + execSync('mv ./cli2.js ./cli.js', () => {}); }); describe('Main test', () => { @@ -68,7 +75,6 @@ describe('fabric-chaincode-node cli', () => { thePromise: Promise.resolve() } }); - require('../../cli.js'); }); diff --git a/test/fv/annotations.js b/test/fv/annotations.js index 1d310921..8f8878c8 100644 --- a/test/fv/annotations.js +++ b/test/fv/annotations.js @@ -19,7 +19,6 @@ describe('Typescript chaincode', () => { before(async function () { this.timeout(LONG_STEP); - return utils.installAndInstantiate(suite); });