File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -39,6 +39,21 @@ is also a plugin to use testing-library queries for end-to-end tests in
39
39
` DOM Testing Library ` works with any environment that provides DOM APIs, such as
40
40
Jest, Mocha + JSDOM, or a real browser
41
41
42
+ ### What you should avoid with Testing Library
43
+
44
+ Testing Library encourages you to avoid testing
45
+ [ implementation details] ( https://kentcdodds.com/blog/testing-implementation-details )
46
+ like the internals of a component you're testing (though it's still possible).
47
+ [ The Guiding Principles] ( /docs/guiding-principles ) of this library emphasize a
48
+ focus on tests that closely resemble how your web pages are interacted by the users.
49
+
50
+ You may want to avoid following implementation details:
51
+
52
+ 1 . Internal state of a component
53
+ 1 . Internal methods of a component
54
+ 1 . Lifecycle methods of a component
55
+ 1 . Child components
56
+
42
57
[ jest ] : https://jestjs.io
43
58
[ jsdom ] : https://github.com/jsdom/jsdom
44
59
[ dom ] : dom-testing-library/intro.md
You can’t perform that action at this time.
0 commit comments