Skip to content

Commit e1ab0d8

Browse files
committed
fix: reword error message for get/getComponent
1 parent e0fd131 commit e1ab0d8

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/vue-wrapper.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ export class VueWrapper<T extends ComponentPublicInstance>
106106
get(selector: string): DOMWrapper<Element> {
107107
const result = this.find(selector)
108108
if (result instanceof ErrorWrapper) {
109-
throw new Error(`Unable to find ${selector} within: ${this.html()}`)
109+
throw new Error(`Unable to get ${selector} within: ${this.html()}`)
110110
}
111111

112112
return result
@@ -145,7 +145,7 @@ export class VueWrapper<T extends ComponentPublicInstance>
145145
const result = this.findComponent(selector)
146146
if (result instanceof ErrorWrapper) {
147147
throw new Error(
148-
`Unable to find component with selector ${selector} within: ${this.html()}`
148+
`Unable to get component with selector ${selector} within: ${this.html()}`
149149
)
150150
}
151151

tests/get.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ describe('get', () => {
2323

2424
const wrapper = mount(Component)
2525
expect(() => wrapper.get('#other-span')).toThrowError(
26-
'Unable to find #other-span within: <div><span id="my-span"></span></div>'
26+
'Unable to get #other-span within: <div><span id="my-span"></span></div>'
2727
)
2828
})
2929
})

tests/getComponent.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ describe('getComponent', () => {
1717
it('should throw if not found', () => {
1818
const wrapper = mount(compA)
1919
expect(() => wrapper.getComponent('.domElement')).toThrowError(
20-
'Unable to find component with selector .domElement within: <div class="A"></div>'
20+
'Unable to get component with selector .domElement within: <div class="A"></div>'
2121
)
2222
})
2323
})

0 commit comments

Comments
 (0)