mardi 6 avril 2021

How to overwrite a library (ex., path) in Angular with the mocked library I have created for testing?

I am working on an Angular application that runs in Electron. However, we use cypress for E2E testing, and therefore I have mocked all the dependencies of Electron. So, we want the mocks to be used only when testing (to allow the app to be compiled in web) and not in the production code. Before I had created mocks in the prod code, but now I have to remove those from there. For example, I have the 'path' library which has to be replaced with the mocked one as soon as I run the test command. Could you please help me to solve that problem?

Aucun commentaire:

Enregistrer un commentaire