Skip to content

Commit

Permalink
Nikos/fix ens event test (#5880)
Browse files Browse the repository at this point in the history
* Expose registry events in ens class

* Add tests for events

* Check for socket

* Skip test

* Try to unskip test

* skip test again

* Update packages/web3-eth-ens/test/integration/ens.events.test.ts

Co-authored-by: Muhammad Altabba <24407834+Muhammad-Altabba@users.noreply.github.com>

* feedback

* Try fix

* Merge branch '4.x'

* Revert conf files

* Remove error for event

---------

Co-authored-by: Junaid <86780488+jdevcs@users.noreply.github.com>
Co-authored-by: Muhammad Altabba <24407834+Muhammad-Altabba@users.noreply.github.com>
  • Loading branch information
3 people authored and spacesailor24 committed Mar 9, 2023
1 parent 3cb0a27 commit c951bb7
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions packages/web3-eth-ens/test/integration/ens.events.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,8 @@ describeIf(isSocket)('ens events', () => {
});
});

// eslint-disable-next-line jest/expect-expect, jest/no-done-callback
test('NewTTL event', async () => {
// eslint-disable-next-line jest/expect-expect, jest/no-done-callback, jest/consistent-test-it
it('NewTTL event', async () => {
// eslint-disable-next-line @typescript-eslint/no-misused-promises, no-async-promise-executor
await new Promise<void>(async resolve => {
const event = ens.events.NewTTL();
Expand All @@ -186,16 +186,19 @@ describeIf(isSocket)('ens events', () => {
it('NewResolver event', async () => {
// eslint-disable-next-line @typescript-eslint/no-misused-promises, no-async-promise-executor
await new Promise<void>(async resolve => {
const mockAddress = '0x0000000000000000000000000000000000000000';
const ENS_NAME = 'web3js.eth';
const event = ens.events.NewResolver();

// eslint-disable-next-line @typescript-eslint/no-unsafe-call
event.on('data', () => {
resolve();
});

await ens.setResolver(ENS_NAME, mockAddress, sendOptions);
await ens.setResolver(
domain,
resolver.options.address as string,
sendOptions,
DEFAULT_RETURN_FORMAT,
);
});
});
});

0 comments on commit c951bb7

Please sign in to comment.