Skip to content

Commit

Permalink
Shebang issue fixed [FABCN-438] (#271)
Browse files Browse the repository at this point in the history
Signed-off-by: Kestutis Gudynas <44440041+kemi04@users.noreply.github.com>
  • Loading branch information
kemi04 authored Apr 22, 2021
1 parent 1d43015 commit 2bd68fd
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion libraries/fabric-shim/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
8 changes: 7 additions & 1 deletion libraries/fabric-shim/test/unit/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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', () => {
Expand Down Expand Up @@ -68,7 +75,6 @@ describe('fabric-chaincode-node cli', () => {
thePromise: Promise.resolve()
}
});

require('../../cli.js');
});

Expand Down
1 change: 0 additions & 1 deletion test/fv/annotations.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ describe('Typescript chaincode', () => {

before(async function () {
this.timeout(LONG_STEP);

return utils.installAndInstantiate(suite);
});

Expand Down

0 comments on commit 2bd68fd

Please sign in to comment.