2
0
mirror of https://github.com/tenrok/vue-meta.git synced 2026-06-22 21:20:34 +03:00

fix: try to detect global mixins adding meta info (#467)

* feat: try to detect global mixins adding meta info

* fix: add find polyfill for ie

* fix: only detect global mixins when Vue.devtools: true
This commit is contained in:
Pim
2019-10-09 11:43:44 +02:00
committed by GitHub
parent 35b7099a07
commit 2231ec1aa1
3 changed files with 52 additions and 10 deletions
+12 -1
View File
@@ -1,7 +1,7 @@
/**
* @jest-environment node
*/
import { findIndex, includes, toArray } from '../../src/utils/array'
import { find, findIndex, includes, toArray } from '../../src/utils/array'
import { ensureIsArray } from '../../src/utils/ensure'
import { hasGlobalWindowFn } from '../../src/utils/window'
@@ -29,6 +29,17 @@ describe('shared', () => {
})
/* eslint-disable no-extend-native */
test('find polyfill', () => {
const _find = Array.prototype.find
Array.prototype.find = false
const arr = [1, 2, 3]
expect(find(arr, (v, i) => i === 0)).toBe(1)
expect(find(arr, (v, i) => i === 3)).toBe(undefined)
Array.prototype.find = _find
})
test('findIndex polyfill', () => {
const _findIndex = Array.prototype.findIndex
Array.prototype.findIndex = false