Skip to content

Reg:Typeorm testcases #13

@adabalasuresh05

Description

@adabalasuresh05

Hi @YegorZaremba ,
I am working on project with node,typeorm and my sql.I need to write unit test case for api's.we followed your sample project.But in my projects we have used query builder as follow

async checkMobilenumber(mobile:string){
     let result : any = null;
    try {
        result = await getManager()
        .getRepository(User)
        .createQueryBuilder('user')
        .where('user.mobile = :mobile')
        .setParameters({ mobile: mobile })
        .getOne();
    } catch (error) {
        logger.error('Error while execute query : ', error);
        throw error;  
    }
    return result;
};

I am requesting could you please help me how to write unit test case for above sample code.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions