Skip to content

Commit a70a887

Browse files
honerokueddyerburgh
authored andcommitted
fix: remove includes and findIndex (#610)
1 parent dbf63bb commit a70a887

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

Diff for: packages/test-utils/src/find-vnodes.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ function findAllVNodes (vnode: VNode, nodes: Array<VNode> = []): Array<VNode> {
2424
}
2525

2626
function removeDuplicateNodes (vNodes: Array<VNode>): Array<VNode> {
27-
return vNodes.filter((vNode, index) => index === vNodes.findIndex(node => vNode.elm === node.elm))
27+
const vNodeElms = vNodes.map(vNode => vNode.elm)
28+
return vNodes.filter((vNode, index) => index === vNodeElms.indexOf(vNode.elm))
2829
}
2930

3031
function nodeMatchesRef (node: VNode, refName: string): boolean {

Diff for: packages/test-utils/src/wrapper.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -517,7 +517,7 @@ export default class Wrapper implements BaseWrapper {
517517
Object.keys(data).forEach((key) => {
518518
// Ignore properties that were not specified in the component options
519519
// $FlowIgnore : Problem with possibly null this.vm
520-
if (!this.vm.$options._propKeys || !this.vm.$options._propKeys.includes(key)) {
520+
if (!this.vm.$options._propKeys || !this.vm.$options._propKeys.some(prop => prop === key)) {
521521
throwError(`wrapper.setProps() called with ${key} property which is not defined on component`)
522522
}
523523

0 commit comments

Comments
 (0)