ฉันมีแอปพลิเคชัน React (ไม่ได้ใช้สร้างแอป React) ที่สร้างโดยใช้ TypeScript, Jest, Webpack และ Babel เมื่อพยายามเรียกใช้ "yarn jest" ฉันได้รับข้อผิดพลาดต่อไปนี้:

ฉันได้ลองลบแพ็กเกจทั้งหมดและเพิ่มใหม่อีกครั้ง มันไม่ได้แก้ปัญหานี้ ฉันได้ดูคำถามและเอกสารประกอบที่คล้ายกันและยังคงมีความเข้าใจผิดอยู่บ้าง ฉันไปจนถึงทำตามคำแนะนำอื่นสำหรับการตั้งค่าสภาพแวดล้อมนี้ตั้งแต่เริ่มต้นและยังได้รับปัญหานี้ด้วยรหัสของฉัน
การพึ่งพารวมถึง ...
"dependencies": {
        "@babel/plugin-transform-runtime": "^7.6.2",
        "@babel/polyfill": "^7.6.0",
        "babel-jest": "^24.9.0",
        "react": "^16.8.6",
        "react-dom": "^16.8.6",
        "react-test-renderer": "^16.11.0",
        "source-map-loader": "^0.2.4"
    },
    "devDependencies": {
        "@babel/core": "^7.6.0",
        "@babel/preset-env": "^7.6.0",
        "@babel/preset-react": "^7.0.0",
        "@types/enzyme": "^3.9.2",
        "@types/enzyme-adapter-react-16": "^1.0.5",
        "@types/jest": "^24.0.13",
สายการนำเข้าของส่วนประกอบ ...
import * as React from "react";
import { BrowserRouter as Router, Route, Switch } from "react-router-dom";
import HomePage from "./components/pages";
import {
    Footer,
    Header,
    Navigation,
} from "./components/shared";
ไฟล์ทดสอบ ....
import * as React from "react";
import * as renderer from "react-test-renderer";
import App from "../App";
it("Renders the Footer correctly", () => {
    const tree = renderer
        .create(<App />)
        .toJSON();
    expect(tree).toMatchSnapshot();
});
ฉันคาดว่าจะสามารถใช้การนำเข้าที่มีชื่อในส่วนประกอบของฉันได้โดยไม่ต้องทำการทดสอบ ดูเหมือนว่าจะแก้ไขปัญหาหากฉันใช้การนำเข้าเริ่มต้นผ่านทางโซลูชันของฉันเท่านั้น แต่ฉันไม่ต้องการไปเส้นทางนั้น
requireแทนimportเพียงไฟล์เดียวนี้