Create a jest.config.js
file and add setupFilesAfterEnv
property to it and configure it to your setupTests.js
file address like this:
module.exports = {
setupFilesAfterEnv: ["<rootDir>/app/config/setupTests.js"],
};
and then in your setupTests.js
add this code:
import "@testing-library/jest-dom/extend-expect";
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…