-
Notifications
You must be signed in to change notification settings - Fork 955
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BE-834 Add unit test for the fix of memory leak issue
Signed-off-by: Atsushi Neki <nekiaiken@gmail.com>
- Loading branch information
Showing
63 changed files
with
2,259 additions
and
7,417 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"require": "./node_modules/ts-node/register", | ||
"watch-extensions": "ts", | ||
"recursive": true, | ||
"spec": ["./app/test/**/*.test.ts"], | ||
"timeout": 5000, | ||
"extension": ["ts"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"extends": "@istanbuljs/nyc-config-typescript", | ||
"require": ["ts-node/register"], | ||
"extension": [".ts"], | ||
"reporter": ["lcov", "text-summary"], | ||
"sourceMap": true, | ||
"instrument": true, | ||
"temp-dir": "app/test/.nyc_output", | ||
"report-dir": "app/test/coverage" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
/* | ||
*SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
/* tslint:disable:no-unused-expression */ | ||
import { expect, use } from 'chai'; | ||
import chaiAsPromised from 'chai-as-promised'; | ||
import sinonChai from 'sinon-chai'; | ||
import { FabricConfig } from '../platform/fabric/FabricConfig'; | ||
|
||
use(chaiAsPromised); | ||
use(sinonChai); | ||
|
||
// export const expect = chai.expect | ||
import proxyquire from 'proxyquire'; | ||
import sinon from 'sinon'; | ||
import { assert } from 'console'; | ||
// import { expect } from './expect' | ||
|
||
describe('setupDiscoveryRequest', () => { | ||
it('should return without error', async () => { | ||
const stubSign = sinon.stub(); | ||
const { FabricGateway } = proxyquire | ||
.noCallThru() | ||
.load('../platform/fabric/gateway/FabricGateway', { | ||
'fabric-common': { | ||
DiscoveryService: function() { | ||
return { | ||
build: sinon.stub(), | ||
sign: stubSign | ||
}; | ||
} | ||
}, | ||
'../../../common/helper': { | ||
helper: { | ||
getLogger: function() {} | ||
} | ||
} | ||
}); | ||
|
||
const config = new FabricConfig(); | ||
config.initialize('first-network', { | ||
name: 'My first network', | ||
profile: './connection-profile/first-network.json' | ||
}); | ||
|
||
const gw = new FabricGateway(config); | ||
const stubGetNetwork = sinon.stub(gw.gateway, 'getNetwork'); | ||
const stubGetChannel = sinon.stub(); | ||
stubGetChannel.returns({}); | ||
stubGetNetwork.returns(Promise.resolve({ getChannel: stubGetChannel })); | ||
await gw.setupDiscoveryRequest('testChannel'); | ||
expect(stubSign.calledOnce).to.be.equal(true); | ||
}); | ||
}); |
Binary file not shown.
This file was deleted.
Oops, something went wrong.
208 changes: 0 additions & 208 deletions
208
app/test/artifacts/help/Test-ubuntu-install-composer.md
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.