Jest
https://gyazo.com/d2855e4ae72918e0576820986472ea42
jest.mock() の仕組み
code:example.test.js
import example_target from "EXAMPLE PATH";
jest.mock("EXAMPLE PATH");
const example_target = 〜;
JestJest.iconを使ふ時BabelBabel.iconに設定を入れるぢゃろ。あれで JestJest.iconが module system を抽象する。どの path から何を import したか JestJest.iconは知ってゐるし弄れると云ふ訣ぢゃ Node.jsNode.js.icon は import した結果を import 元 file 毎に cache するから、jest.mock() は使った test file 全體に效果が及んでしまふ