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

292
Views
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
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!