Skip to content

Commit

Permalink
chore: changed tests to run on happy-dom
Browse files Browse the repository at this point in the history
Signed-off-by: Marin Petrunic <[email protected]>
  • Loading branch information
mpetrunic committed Jan 24, 2024
1 parent 8d9b1be commit 87b0bdf
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 4 deletions.
1 change: 1 addition & 0 deletions packages/widget/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
"@open-wc/testing-helpers": "^3.0.0",
"eslint": "^8.48.0",
"eslint-plugin-lit": "^1.9.1",
"happy-dom": "^13.3.1",
"jsdom": "^23.2.0",
"lit-analyzer": "^2.0.3",
"rollup-plugin-visualizer": "^5.9.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,7 @@ describe('address-input component', function () {
]);
});

// NOTE: this is not passing due to decodeAddress call failing in validateSubstrateAddress
// it seems checksum fails when running this on jsdom env
it.skip('triggers callback on address change and validates Substrate address', async () => {
it('triggers callback on address change and validates Substrate address', async () => {
const mockAddressChangeHandler = vi.fn();

const el = await fixture(html`
Expand Down
2 changes: 1 addition & 1 deletion packages/widget/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export default defineConfig({
},
},
test: {
environment: 'jsdom',
environment: 'happy-dom',
include: ['**/*.test.ts'],
exclude: ['**/node_modules/**', '**/dist/**', '**/build/**']
}
Expand Down
19 changes: 19 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,7 @@ __metadata:
eslint-plugin-lit: "npm:^1.9.1"
ethers: "npm:5.7.2"
events: "npm:^3.3.0"
happy-dom: "npm:^13.3.1"
jsdom: "npm:^23.2.0"
lit: "npm:3.0.0"
lit-analyzer: "npm:^2.0.3"
Expand Down Expand Up @@ -7263,6 +7264,17 @@ __metadata:
languageName: node
linkType: hard

"happy-dom@npm:^13.3.1":
version: 13.3.1
resolution: "happy-dom@npm:13.3.1"
dependencies:
entities: "npm:^4.5.0"
webidl-conversions: "npm:^7.0.0"
whatwg-mimetype: "npm:^3.0.0"
checksum: e9605d17f1d5219c4fab325614c65fd8c01f244d1b0ff7714cec679fb1d00e9af74e458871999bd1fb202d84b57d6f90798358c08b2ee48fcf0a7cb406678993
languageName: node
linkType: hard

"har-schema@npm:^2.0.0":
version: 2.0.0
resolution: "har-schema@npm:2.0.0"
Expand Down Expand Up @@ -12389,6 +12401,13 @@ __metadata:
languageName: node
linkType: hard

"whatwg-mimetype@npm:^3.0.0":
version: 3.0.0
resolution: "whatwg-mimetype@npm:3.0.0"
checksum: 323895a1cda29a5fb0b9ca82831d2c316309fede0365047c4c323073e3239067a304a09a1f4b123b9532641ab604203f33a1403b5ca6a62ef405bcd7a204080f
languageName: node
linkType: hard

"whatwg-mimetype@npm:^4.0.0":
version: 4.0.0
resolution: "whatwg-mimetype@npm:4.0.0"
Expand Down

0 comments on commit 87b0bdf

Please sign in to comment.