📜  如何用酶测试使用效果 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:03:40.589000             🧑  作者: Mango

代码示例1
import React from "react";
import { render, unmountComponentAtNode } from "react-dom";
import { act } from "react-dom/test-utils";

import Contact from "./contact";
import MockedMap from "./map";

jest.mock("./map", () => {
  return function DummyMap(props) {
    return (
      

A dummy map.

); }; }); it("should render contact information", () => { const center = { lat: 0, long: 0 }; act(() => { render( , container ); }); });