【发布时间】:2021-02-12 15:28:06
【问题描述】:
我在运行 npm 运行测试时遇到问题。错误是
[Vue warn]: Unknown custom element: <nuxt-link> - did you register the component correctly? For recursive components, make sure to provide the "name" option.
SidebarCMS.spect.js
import { shallowMount } from "@vue/test-utils";
import SidebarCMS from "../layouts/SidebarCMS";
const factory = () => {
return shallowMount(SidebarCMS, {});
};
describe("SidebarCMS", () => {
test("renders properly", () => {
const wrapper = factory();
expect(wrapper.html()).toMatchSnapshot();
});
});
谁能帮帮我?
【问题讨论】: