diff --git a/docs/testing/overview.md b/docs/testing/overview.md index 2abafda..0b9702c 100644 --- a/docs/testing/overview.md +++ b/docs/testing/overview.md @@ -4,7 +4,7 @@ At MetaMask, we are committed to delivering high-quality software. A key aspect ## What are unit tests? -Unit testing is a conceptually vague practice, as there is no consensus on how they should be written and what they should test. But in general, [as outlined by Martin Fowler](https://martinfowler.com/articles/2021-test-shapes.html), there are two common approaches: solitary unit tests and sociable unit tests. At MetaMask, we employ both of these types of unit tests (see [discussion on the use cases of each type](https://github.com/MetaMask/core/pull/3827#discussion_r1469377179)) +Unit testing is a conceptually vague practice, as there is no consensus on how they should be written and what they should test. But in general, [as outlined by Martin Fowler](https://martinfowler.com/articles/2021-test-shapes.html), there are two common approaches: solitary unit tests and sociable unit tests. At MetaMask, we employ both of these types of unit tests (see [discussion on the use cases of each type](https://github.com/MetaMask/core/pull/3827#discussion_r1469377179)). Unit tests examine individual components or functions in isolation or within their immediate context. At MetaMask we encourage a flexible approach to unit testing, recognizing the spectrum between sociable and solitary unit tests. ### When to write unit tests? diff --git a/docs/testing/ui-integration-testing.md b/docs/testing/ui-integration-testing.md index f03c725..ef31e1c 100644 --- a/docs/testing/ui-integration-testing.md +++ b/docs/testing/ui-integration-testing.md @@ -24,4 +24,4 @@ Refrain from using snapshot testing in UI integration tests. They tend to be les ## Don't Mock UI Components -Keep mocking to minimum. Ideally only the background connection (MetaMask Extension), or any network request (fired from the UI) should be mocked. +Keep mocking to minimum. Ideally only the background connection (MetaMask Extension), or any network request (fired from the UI) should be mocked. Avoid mocking any UI components or hooks. For mocking the background connection we can use jest, for mocking network requests we can use `nock` (or `msw`).