Skip to content

Commit

Permalink
configure EventEmitter test to run inside jsdom
Browse files Browse the repository at this point in the history
  • Loading branch information
Muhammad-Altabba committed Oct 4, 2023
1 parent 4c8bc1b commit e4d7317
Show file tree
Hide file tree
Showing 3 changed files with 370 additions and 11 deletions.
1 change: 1 addition & 0 deletions packages/web3-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-import": "^2.26.0",
"jest": "^28.1.3",
"jest-environment-jsdom": "^29.7.0",
"jest-extended": "^3.0.1",
"js-sha3": "^0.8.0",
"prettier": "^2.7.1",
Expand Down
13 changes: 8 additions & 5 deletions packages/web3-utils/test/unit/event_emitter_dom.test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/**
* @jest-environment jsdom
*/

/*
This file is part of web3.js.
Expand All @@ -15,12 +19,11 @@ You should have received a copy of the GNU Lesser General Public License
along with web3.js. If not, see <http://www.gnu.org/licenses/>.
*/

// this file will contain the unit test for the event emitter in the DOM environment

/**
* @jest-environment jsdom
*/
// this file contains the unit test for the event emitter in the DOM environment
// it is executed in the jsdom environment (see "@jest-environment jsdom" in the top comment of this file)

// ignore the following rule to allow keeping `@jest-environment jsdom` on top:
// eslint-disable-next-line header/header
import { EventEmitter } from '../../src/event_emitter';

describe('EventEmitter with DOM', () => {
Expand Down
Loading

0 comments on commit e4d7317

Please sign in to comment.