弹出“创建反应应用玩笑报道”报告不准确

时间:2019-09-13 16:31:08

标签: reactjs jestjs

我使用create-react-app创建一个应用,然后弹出该应用。当前正在做我的测试套件,我想显示我的测试范围,所以在package.json下添加了“ collectCoverage”:true。运行测试后,它不会显示测试覆盖率的百分比

enter image description here

我需要做些什么吗?

这是Links.test.jsx

import React from "react";
import { shallow, mount } from "enzyme";

import Links from "./Links";

it("should show correct links", () => {
  const wrapper = mount(<Links />);

  expect(wrapper).toMatchSnapshot();
});

下面是正在测试的链接组件

import React from "react";

const Links = () => {
  return (
    <div className="container mb-4 mt-4" id="Links">
      <div className="h4 mb-3">OUR LINKS</div>
      <div className="d-flex justify-content-between flex-wrap mw-90">
        <a
          href="https://site.ca/sites.aspx"
          target="_blank"
          className="buttonImage siteImage"
        >
          <div className="darkenBackground d-flex flex-column justify-content-center">
            <div className="text-center h4">My Site</div>
          </div>
        </a>
        <a href="#" target="_blank" className="buttonImage mapsImage">
          <div className="darkenBackground d-flex flex-column justify-content-center">
            <div className="text-center h4">Maps</div>
          </div>
        </a>
        <a href="#" target="_blank" className="buttonImage loopImage">
          <div className="darkenBackground d-flex flex-column justify-content-center">
            <div className="text-center h4">Social</div>
          </div>
        </a>
        <a href="#" target="_blank" className="buttonImage polcyImage">
          <div className="darkenBackground d-flex flex-column justify-content-center">
            <div className="text-center h4">
              Acceptable Use <br /> and Security Policies
            </div>
          </div>
        </a>
      </div>
    </div>
  );
};

export default Links;

0 个答案:

没有答案