Skip to content

Commit 66d8049

Browse files
author
arnoson
committed
fix: use correct type
1 parent 3803a96 commit 66d8049

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

tests/index.test.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ import {
33
registerComponent,
44
mountComponent,
55
mountComponents,
6-
defineProps
6+
defineProps,
7+
SimpleElement
78
} from '../src'
89

910
it('mounts a component', () => {
@@ -162,11 +163,13 @@ it('interferes prop types from default values', () => {
162163

163164
it(`exposes the component function's return value`, () => {
164165
const exposed = { test: () => {} }
165-
registerComponent('test', () => exposed)
166+
const component = registerComponent('test', () => exposed)
166167

167168
document.body.innerHTML = `
168169
<div data-simple-component="test" id="my-id"></div>
169170
`
171+
170172
mountComponents(document.body)
171-
expect(document.getElementById('my-id')?.$component).toBe(exposed)
173+
const el = document.getElementById('my-id') as SimpleElement<typeof component>
174+
expect(el.$component).toBe(exposed)
172175
})

0 commit comments

Comments
 (0)