Skip to content

Commit

Permalink
FABN-1455: Re-enable unit tests for transactioneventhandler.js (#99)
Browse files Browse the repository at this point in the history
Signed-off-by: Mark S. Lewis <mark_lewis@uk.ibm.com>
  • Loading branch information
bestbeforetoday authored and heatherlp committed Jan 23, 2020
1 parent f5ab6a8 commit ca25500
Show file tree
Hide file tree
Showing 4 changed files with 611 additions and 1,048 deletions.
18 changes: 10 additions & 8 deletions fabric-network/test/contract.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,27 +42,29 @@ describe('Contract', () => {
let discoveryService;

beforeEach(() => {
discoveryService = sinon.createStubInstance(DiscoveryService);
discoveryService.newHandler.returns('handler');

channel = sinon.createStubInstance(Channel);
channel.newDiscoveryService = sinon.stub().returns(discoveryService);
channel.newDiscoveryService.returns(discoveryService);

gateway = sinon.createStubInstance(Gateway);
gateway.identityContext = 'idx';
gateway.getOptions = sinon.stub().returns({
gateway.getOptions.returns({
transaction: 'options',
discovery: {
asLocalhost: true
}
});

network = new Network(gateway, channel);

transaction = sinon.createStubInstance(Transaction);
transaction.submit.resolves('result');
transaction.evaluate.resolves('result');

endorsement = sinon.createStubInstance(Endorsement);
endorsement.buildProposalInterest = sinon.stub().returns('interest');
discoveryService = sinon.createStubInstance(DiscoveryService);
discoveryService.newHandler = sinon.stub().returns('handler');
discoveryService.build = sinon.stub();
discoveryService.sign = sinon.stub();
discoveryService.send = sinon.stub().resolves();
endorsement.buildProposalInterest.returns('interest');

Contract.__set__('ContractEventListener', FakeListener);
contract = new Contract(network, chaincodeId, namespace, collections);
Expand Down
Loading

0 comments on commit ca25500

Please sign in to comment.