首页 > 解决方案 > Vue Test Utils Expression 产生了一个过于复杂而无法表示的联合类型

问题描述

shallowMount我在 typescript 中使用from创建了一个非常简单的测试@vue/test-utils,它向我显示警告声音Expression produces a union type that is too complex to represent.(看图)。不知道它是什么?

import { shallowMount } from '@vue/test-utils'
import Login from '@/views/Account/Login.vue'

describe('Login Page Test', () => {
    it('renders input for email', () => {
        const wrapper = shallowMount(Login)
        expect(wrapper.find("input"))
    })
})

警告 捕获 警告

标签: typescriptvue.jsunit-testing

解决方案


推荐阅读