Skip to content
This repository was archived by the owner on Jul 30, 2020. It is now read-only.

Commit c26cf45

Browse files
committed
docs: add guiding principles to readme
1 parent 028a49f commit c26cf45

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@
4242
- [Hooks](#hooks)
4343
- [Inspiration](#inspiration)
4444
- [Other Solutions](#other-solutions)
45+
- [Guiding Principles](#guiding-principles)
46+
- [Contributors](#contributors)
4547

4648
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
4749

@@ -167,6 +169,27 @@ The awesome engineers at [Callstack](https://callstack.com/) built a similar pac
167169
If you find yourself needing things like shallow rendering and the ability to query elements
168170
by type and props, you'll definitely want to check it out!
169171

172+
## Guiding Principles
173+
174+
> [The more your tests resemble the way your software is used, the more confidence they can give you.](https://twitter.com/kentcdodds/status/977018512689455106)
175+
176+
We try to only expose methods and utilities that encourage you to write tests that closely resemble
177+
how your apps are used.
178+
179+
Utilities are included in this project based on the following guiding principles:
180+
181+
1. If it relates to rendering components, it deals with native views rather than component
182+
instances, nor should it encourage dealing with component instances.
183+
2. It should be generally useful for testing the application components in the way the user would
184+
use it. We are making some trade-offs here because we're using a computer and often a simulated
185+
environment, but in general, utilities should encourage tests that use the components the way
186+
they're intended to be used.
187+
3. Utility implementations and APIs should be simple and flexible.
188+
189+
In summary, we believe in the principles of `testing-library`, and adhere to them as closely as
190+
possible. At the end of the day, what we want is for this library to be pretty light-weight, simple,
191+
and understandable.
192+
170193
## Contributors
171194

172195
Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):

0 commit comments

Comments
 (0)