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

188
Views
Cómo usar la ruta absoluta en la enzima

Uso Enzyme y React 17.0.2 juntos

jsconfig.json

 { "compilerOptions": { "baseUrl": "src" }, "include": [ "src" ] }

enzimaConfig.js

 import { configure } from "enzyme"; import Adapter from "@wojtekmaj/enzyme-adapter-react-17"; configure({ adapter: new Adapter() });

Iniciar sesión.test.js

 import React from "react"; import { mount } from "enzyme"; import '../../enzymeConfig'; import Login from "components/Layout/Login/FormSide/Login"; describe('Test login form', () => { let wrapper; it("Username created correctly.", function () { wrapper = mount(<Login />); wrapper.find('input[type="text"]').simulate("change", { target: { value: 'something' } }); expect(wrapper.state("username")).toEqual("world"); }); });

Uso absolute path in react y no tengo problemas, pero en Enzyme el siguiente error:

 Cannot find module 'components/Layout/Login/FormSide/Login' from 'src/__tests__/Login.test.js'

¿Cómo puedo usar la ruta absoluta en Enzyme?

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!