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

4x tests updates #7162

Merged
merged 21 commits into from
Aug 2, 2024
Merged
Show file tree
Hide file tree
Changes from 18 commits
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
8 changes: 8 additions & 0 deletions packages/web3-core/src/web3_config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,14 @@ export abstract class Web3Config
const keys = Object.keys(options) as (keyof Web3ConfigOptions)[];
for (const key of keys) {
this._triggerConfigChange(key, options[key]);

if(!isNullish(options[key]) &&
typeof options[key] === 'number' &&
key === 'maxListenersWarningThreshold' )
{
// additionally set in event emitter
this.setMaxListenerWarningThreshold(Number(options[key]));
Copy link
Contributor Author

Choose a reason for hiding this comment

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

bug fix: #5079 (comment)

}
}
Object.assign(this.config, options);
}
Expand Down
2 changes: 1 addition & 1 deletion packages/web3-eth-contract/test/integration/setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ along with web3.js. If not, see <http://www.gnu.org/licenses/>.
// eslint-disable-next-line @typescript-eslint/no-require-imports
require('../config/setup');

const jestTimeout = String(process.env.WEB3_SYSTEM_TEST_PROVIDER).includes('ipc') ? 35000 : 15000;
const jestTimeout = String(process.env.WEB3_SYSTEM_TEST_PROVIDER).includes('ipc') ? 35000 : 25000;

jest.setTimeout(jestTimeout);
9 changes: 4 additions & 5 deletions packages/web3-eth-contract/test/unit/contract.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ import {
GreeterWithOverloadingBytecode,
} from '../shared_fixtures/build/GreeterWithOverloading';
import { AllGetPastEventsData, getLogsData, getPastEventsData } from '../fixtures/unitTestFixtures';
import { getSystemTestProvider } from '../fixtures/system_test_utils';
import { erc721Abi } from '../fixtures/erc721';
import { ERC20TokenAbi } from '../shared_fixtures/build/ERC20Token';
import { processAsync } from '../shared_fixtures/utils';
Expand Down Expand Up @@ -150,7 +149,7 @@ describe('Contract', () => {
});

it('should set the provider, from options, upon instantiation', () => {
const provider = getSystemTestProvider();
const provider = "http://127.0.0.1:4545";
const contract = new Contract([], '', {
provider,
});
Expand All @@ -162,7 +161,7 @@ describe('Contract', () => {
});

it('should set the provider, from context, upon instantiation', () => {
const provider = getSystemTestProvider();
const provider = "http://127.0.0.1:4545";
const contract = new Contract(
[],
'',
Expand Down Expand Up @@ -816,9 +815,9 @@ describe('Contract', () => {
'0x00000000219ab540356cBB839Cbe05303d7705Fa',
{ gas: '0x97254' },
);

contract.maxListenersWarningThreshold = 1000;

const clonnedContract = contract.clone();

expect(stringify(contract)).toStrictEqual(stringify(clonnedContract));

contract.options.jsonInterface = GreeterAbi;
Expand Down
2 changes: 1 addition & 1 deletion packages/web3-eth/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"test:e2e:sepolia": "jest --config=./test/e2e/jest.config.js --forceExit",
"test:watch": "npm test -- --watch",
"test:unit": "jest --config=./test/unit/jest.config.js",
"test:integration": "jest --config=./test/integration/jest.config.js --runInBand --forceExit",
"test:integration": "jest --config=./test/integration/jest.config.js --runInBand",
"test:coverage:integration": "jest --config=./test/integration/jest.config.js --runInBand --forceExit --coverage=true --coverage-reporters=text",
"test:e2e:electron": "npx cypress run --headless --browser electron",
"test:e2e:chrome": "npx cypress run --headless --browser chrome",
Expand Down
Loading
Loading