Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reg:Typeorm testcases #13

Open
adabalasuresh05 opened this issue Aug 4, 2020 · 0 comments
Open

Reg:Typeorm testcases #13

adabalasuresh05 opened this issue Aug 4, 2020 · 0 comments

Comments

@adabalasuresh05
Copy link

adabalasuresh05 commented Aug 4, 2020

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant