Javascript 当我在Jest中导入组件时,所有测试都失败
我正在学习如何使用Jest+酶,但我的代码无缘无故被破坏了。我的代码是这样的:Javascript 当我在Jest中导入组件时,所有测试都失败,javascript,unit-testing,jestjs,enzyme,Javascript,Unit Testing,Jestjs,Enzyme,我正在学习如何使用Jest+酶,但我的代码无缘无故被破坏了。我的代码是这样的: describe('Testing my project', () => { test("Looking at wrapper contents", () => { const wrapper = shallow(<HomePage />); const x = true; expect(x).toBe(true);
describe('Testing my project', () => {
test("Looking at wrapper contents", () => {
const wrapper = shallow(<HomePage />);
const x = true;
expect(x).toBe(true);
});
});
description('测试我的项目',()=>{
测试(“查看包装内容”,()=>{
常量包装器=浅();
常数x=真;
期望(x),期望(真);
});
});
不排队
const wrapper = shallow(<HomePage />);
const wrapper=shallow();
一切都很完美。但是当我加上那一行时,所有的测试都失败了。我知道主页组件已正确导入
为什么会这样?你能为你的主页发布代码吗?