Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

163
Views
Token inesperado 'exportación' Jest (react-extras)

Estoy probando algunos componentes de React y usando Jest encontré un problema inesperado para importar 'react-extras'. Traté de resolver usando transformIgnorePatterns en mi archivo de configuración de Jest, pero no resolvió el problema.

He visto problemas relacionados, pero ninguno de ellos terminó ayudándome.

Nota: react-extras se exporta como módulo

Asuntos relacionados:

  • https://github.com/sindresorhus/react-extras/issues/16
  • https://github.com/facebook/jest/issues/12824

Salida de broma:

 Details: C:\Users\allan\teste-tecnico-brainn\node_modules\react-extras\dist\index.js:1 ({"Object.<anonymous>":function(module,exports,require,__dirname,__filename,jest){export { default as autoBind } from 'auto-bind/react'; SyntaxError: Unexpected token 'export' 1 | import { ChangeEvent, useContext, useEffect, useState } from 'react' > 2 | import { For } from 'react-extras' | ^

Mi archivo de configuración Jest (como JSON):

 { "moduleNameMapper": { "~/(.*)": "<rootDir>/src/$1" }, "transformIgnorePatterns": [ "/node_modules/(?!(react-extras)/)" ], "setupFilesAfterEnv": [ "@testing-library/jest-dom/extend-expect" ], "testMatch": [ "**/?(*.)spec.ts?(x)", "**/?(*.)test.ts?(x)" ], "globals": { "ts-jest": { "tsconfig": "tsconfig.json", "diagnostics": false } }, "testEnvironment": "jsdom", "preset": "ts-jest" }

Puedes ver mi repositorio haciendo click aquí .

about 4 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 Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!