Skip to content

Commit 633fdbd

Browse files
committed
refactor: use getBrowserState
1 parent 07a6fe2 commit 633fdbd

4 files changed

Lines changed: 5 additions & 5 deletions

File tree

packages/browser/src/client/tester/aria.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ import type {
66
} from 'ivya/aria'
77
import * as aria from 'ivya/aria'
88
import { Snapshots } from 'vitest'
9-
import { __INTERNAL } from 'vitest/internal/browser'
9+
import { getBrowserState } from '../utils'
10+
11+
getBrowserState().aria = aria
1012

1113
const {
1214
generateAriaTree,
@@ -16,8 +18,6 @@ const {
1618
renderAriaTree,
1719
} = aria
1820

19-
__INTERNAL._aria = aria
20-
2121
const ariaSnapshotAdapter: DomainSnapshotAdapter<AriaNode, AriaTemplateNode> = {
2222
name: 'aria',
2323

packages/browser/src/client/tester/context.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -557,6 +557,6 @@ export const utils = {
557557
getElementLocatorSelectors,
558558
configurePrettyDOM,
559559
get aria() {
560-
return __INTERNAL._aria
560+
return getBrowserState().aria
561561
},
562562
}

packages/browser/src/client/utils.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ export interface BrowserRunnerState {
9595
send: (method: string, params?: Record<string, unknown>) => Promise<unknown>
9696
emit: (event: string, payload: unknown) => void
9797
}
98+
aria: typeof import('ivya/aria')
9899
}
99100

100101
/* @__NO_SIDE_EFFECTS__ */

packages/vitest/src/public/browser.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ export const __INTERNAL: {
5555
_asLocator: (lang: 'javascript', selector: string) => string
5656
_createLocator: (selector: string) => any
5757
_extendedMethods: Set<string>
58-
_aria?: unknown
5958
} = {
6059
_extendedMethods: new Set(),
6160
} as any

0 commit comments

Comments
 (0)