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:
+12
-1
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user