我遇到SyntaxError: /test/ut/client/breadcrumbs/BreadCrumbs.ut.test.js: Unexpected token (12:6)
错误。代码如下。由于测试失败,因此代码覆盖率为0%。
我正在使用jest v-"^24.8.0"
,jest-dom v-"^3.5.0"
,jest-junit v-"^6.4.0"
describe("BreadCrumbs", () => {
afterEach(cleanup);
test("Should render breadcrumbs on usecase page", () => {
const useCaseBreadCrumbs = create(
<BreadCrumbs
list={USECASE_BREADCRUMBS.list}
disabledLabel={USECASE_BREADCRUMBS.disabledLink}
/>
);
console.log(useCaseBreadCrumbs);
expect(tree).toMatchSnapshot();
});
});
答案 0 :(得分:0)
您需要在顶部添加import React from "react";