• Jobs
  • About Us
  • professionals
    • Home
    • Jobs
    • Courses and challenges
  • business
    • Home
    • Post vacancy
    • Our process
    • Pricing
    • Assessments
    • Payroll
    • Blog
    • Sales
    • Salary Calculator

0

221
Views
broma: _interopRequireWildcard no está definido

Estoy usando swc/jest en lugar de ts-jest y babel-jest para ejecutar mis pruebas con jest . Funciona para todas las pruebas, excepto aquellas que deben tratar con archivos que tienen importaciones o exportaciones de comodines (es decir: import * from "./myfile" ).

Al igual que babel , swc/jest transforma la importación de comodín ( * ) en _interopRequireWildcard(require("./myfile")) . (ver pruebas swc ). Pero al hacerlo, jest arroja el siguiente error:

ReferenceError: _interopRequireWildcard no está definido

Aquí está mi configuración de broma:

 const path = require("path"); const resolve = (_path) => path.resolve(__dirname, _path); module.exports = { testURL: "http://localhost", testEnvironment: "jsdom", snapshotSerializers: ["jest-serializer-html"], testPathIgnorePatterns: ["e2e/", ".*donottest.*"], transform: { "^.+\\.(t|j)sx?$": ["@swc/jest"], }, setupFiles: ["jest-canvas-mock"], testRegex: "(/__tests__/.*|(\\.|/)(test|spec))\\.(jsx?|tsx?)$", moduleFileExtensions: ["js", "jsx", "json", "ts", "tsx", "svg"], globals: { "ts-jest": { tsconfig: resolve("./tsconfig.test.json"), diagnostics: false, }, }, };

¿Cómo arreglar esto?

almost 3 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Our process Sales
Legal
Terms and conditions Privacy policy
© 2025 PeakU Inc. All Rights Reserved.

Andres GPT

Recommend me some offers
I have an error