Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

294
Vistas
testing with jest: can't find module and maybe wrong logic

Im trying to make a test which verify the ownership of a ticket by the id of a customer. I use jest. In my test file I can't find the file which contains my usecase. this is my ownershipTicket usecase

class proprietaireTicket {
 async constructor() {
     async
     verifierProprietaire(ticketId, clientId)
     {
         let response = await controllerTicket(ticketId, clientId);
         if (response == clientId) return true;
         else false;
     }
 }
}
module.exports = new proprietaireTicket();

and here is my test

const proprietaireTicket = require('./use_case/ticket/proprietaireTicket.js')
test('Il s agit du proprietaire du ticket', ()=>{
  expect(proprietaireTicket.clientId(5555)).toBe(true)})

first my test can't pass because , and I don't understand why

 Cannot find module './use_case/ticket/proprietaireTicket.js' from 'test/usecase/proprietaireTicket.test.js'

Also, do I have the good logic for the test with a random ID without persistency? thank you

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda