From 7c2aaacf1339d27395154518ef3d63e85045a855 Mon Sep 17 00:00:00 2001 From: Xymorot Date: Fri, 22 Nov 2019 21:31:10 +0100 Subject: [PATCH] doc: clarify mocks documentation --- README.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index baad8f6..3d8a4c7 100644 --- a/README.md +++ b/README.md @@ -59,8 +59,12 @@ The testing framework of choice is [Mocha](https://mochajs.org/). Call `npm run There are 2 ways in which mocks are defined/used: -0. for external modules, in [mocks](mocks), uses the [rewiremock](https://github.com/theKashey/rewiremock) package; use this only when there is some magic happening like for electron which normally runs in its own node process -1. for own modules, just beside their test file in [tests](tests); name the file `*.mock.ts` and use other files for orientation; use sparingly and only when not having a mock makes it more complex e.g. for modules which interact with the file system +0. for external modules, in [mocks](mocks) + - uses the [rewiremock](https://github.com/theKashey/rewiremock) package + - use this only when there is some magic happening like for electron which normally runs in its own node process +1. for own modules, just beside their test file in [tests](tests) + - name the file `*.mock.ts` and use existing mock files for orientation on how to build them + - use sparingly and only when not having a mock makes it more complex e.g. for modules which interact with the file system #### Tagging