Skip to content

Commit e667301

Browse files
FABN-1582: Unit test for option pollution between gateway instances (#261)
Signed-off-by: Mark S. Lewis <[email protected]>
1 parent 0d56639 commit e667301

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

fabric-network/test/gateway.js

+23
Original file line numberDiff line numberDiff line change
@@ -436,6 +436,29 @@ describe('Gateway', () => {
436436
return gateway.connect(connectionProfile, options)
437437
.should.be.rejectedWith(tlsIdentity.type);
438438
});
439+
440+
it('options do not pollute other gateway instances', async () => {
441+
const discoveryEnabledGateway = new Gateway();
442+
await discoveryEnabledGateway.connect(connectionProfile, {
443+
wallet,
444+
identity: options.identity,
445+
discovery: {
446+
enabled: true
447+
}
448+
});
449+
450+
const discoveryDisabledGateway = new Gateway();
451+
await discoveryDisabledGateway.connect(connectionProfile, {
452+
wallet,
453+
identity: options.identity,
454+
discovery: {
455+
enabled: false
456+
}
457+
});
458+
459+
discoveryEnabledGateway.getOptions().discovery.enabled.should.be.true;
460+
discoveryDisabledGateway.getOptions().discovery.enabled.should.be.false;
461+
});
439462
});
440463

441464
describe('#getOptions', () => {

0 commit comments

Comments
 (0)