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