File tree Expand file tree Collapse file tree 3 files changed +6
-4
lines changed Expand file tree Collapse file tree 3 files changed +6
-4
lines changed Original file line number Diff line number Diff line change 88 "test:watch" : " pnpm run test --watch"
99 },
1010 "devDependencies" : {
11+ "@testing-library/jest-dom" : " ^6.4.5" ,
1112 "jest" : " ^29.7.0" ,
1213 "jest-environment-jsdom" : " ^29.7.0" ,
1314 "svelte" : " ^5.0.0-next.139" ,
3132 "extensionsToTreatAsEsm" : [
3233 " .svelte"
3334 ],
35+ "setupFilesAfterEnv" : [
36+ " @testing-library/jest-dom"
37+ ],
3438 "testEnvironment" : " jsdom"
3539 }
3640}
Original file line number Diff line number Diff line change 1- import { test , afterEach } from '@jest/globals'
21import { mount , unmount , tick } from 'svelte'
32
43import Subject from './legacy.svelte'
@@ -18,7 +17,7 @@ test('render', () => {
1817
1918 const button = document . querySelector ( 'button' )
2019
21- expect ( button ) . toBeInstanceOf ( HTMLButtonElement )
20+ expect ( button ) . toHaveRole ( 'button' )
2221} )
2322
2423test ( 'interaction' , async ( ) => {
Original file line number Diff line number Diff line change 1- import { test , afterEach } from '@jest/globals'
21import { mount , unmount , tick } from 'svelte'
32
43import Subject from './modern.svelte'
@@ -18,7 +17,7 @@ test('render', () => {
1817
1918 const button = document . querySelector ( 'button' )
2019
21- expect ( button ) . toBeInstanceOf ( HTMLButtonElement )
20+ expect ( button ) . toHaveRole ( 'button' )
2221} )
2322
2423test ( 'interaction' , async ( ) => {
You can’t perform that action at this time.
0 commit comments