Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

caliper-ethereum : Add new tests for connectorFactory and ethereum-connector #1560

Open
wants to merge 18 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update 'describe' messages and remove empty test suites
Signed-off-by: Abhinav Pandey <[email protected]>
  • Loading branch information
Sweetdevil144 committed May 21, 2024
commit 40a06d40a21b478136134ae5a25017c3419ffd78
11 changes: 6 additions & 5 deletions packages/caliper-ethereum/test/ethereum-connector.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ describe('EthereumConnector', function () {
ConfigUtil.set(ConfigUtil.keys.NetworkConfig, tempConfigFilePath);
});

describe('EthereumConnector.installSmartContract', () => {
describe('While installing a Smart Contract, it', () => {
it('should deploy all contracts successfully when no privacy settings are used', async () => {
const workerIndex = 0;
const bcType = 'ethereum';
Expand All @@ -44,10 +44,9 @@ describe('EthereumConnector', function () {
});
});

describe('EthereumConnector.init', () => {});

describe('EthereumConnector.checkConfig()', function () {
it('should throw an error for an incorrect url path', function () {
describe('When constructed with an invalid url path', function () {
it('should throw an error', function () {
const invalidConfig = path.resolve(
__dirname,
'./sample-configs/invalidUrlConfig.json'
Expand All @@ -59,8 +58,10 @@ describe('EthereumConnector', function () {
'https://github.com/hyperledger/caliper/issues/776#issuecomment-624771622'
);
});
});

it('should throw an error for absent url path', function () {
describe('When constructed with absent url path', function () {
it('should throw an error', function () {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test should be part of the connector factory. As stated before we don't want to have tests that directly test the constructor of the EthereumConnector as it isn't really a public constructor. Please move this test to the ConnectorFactory tests.

const invalidConfig = path.resolve(
__dirname,
'./sample-configs/noUrlConfig.json'
Expand Down