You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
1. Dynamic imports (e.g. `import("...")`) were implemented in ES2020:
43
+
- Does your runtime environment support this? Node started [support](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/import#browser_compatibility) in 13.2.0
44
+
- If using typescript, is your `module` set to [ES2020](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-8.html#es2020-for-target-and-module) or later?
45
+
1. Top level await statements were implemented in ES2022:
46
+
- Does your runtime environment support this? Node started [support](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await#browser_compatibility) in 14.8.0.
47
+
- If using typescript, is your `module` set to [ES2022](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-4-5.html#module-es2022) or later?
48
+
15
49
## Goals
16
50
17
51
### Why mock?
18
52
19
-
Unfortunately there exist scenarios where you may not what to render a child component; for example when that child component is delay loaded, complex, unstable, server driven, or not owned by you directly and is already covered by integration or end to end testing scenarios.
53
+
Unfortunately there exist scenarios where you may not want to render a child component; for example when that child component is delay loaded, complex, unstable, server driven, or not owned by you directly and is already covered by integration or end to end testing scenarios.
54
+
55
+
A good example scenario is [Stripe's React Elements Component](https://www.npmjs.com/package/@stripe/react-stripe-js) and [Adyen's web components](https://www.npmjs.com/package/@adyen/adyen-web) both of which have the following implementation details which make it difficult to test cleanly:
20
56
21
-
A good example scenario is [Stripe's React Elements Component](https://www.npmjs.com/package/@stripe/react-stripe-js) and [Adyen's web components](https://www.npmjs.com/package/@adyen/adyen-web) which has a significant amount of internal logic, server side driven logic, along with use of iframes for security purposes making it much more difficult to test cleanly.
57
+
- a significant amount of internal logic
58
+
- server side driven logic
59
+
- the use of iframes limiting access to textfields (for credit card security purposes)
22
60
23
61
To create a full integration test for this scenario would be extremely complex, costly, and constantly unpredictable as Stripe and Adyen can change the rendering of the components from their server side causing random instability of your tests.
0 commit comments