This commit is contained in:
github-actions[bot]
2023-08-31 13:18:18 +00:00
parent b0c5c1cf88
commit 05c63fe249
22 changed files with 43 additions and 43 deletions
+2 -2
View File
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
!function(){"use strict";var e,t,n,r,o,f={},a={};function c(e){var t=a[e];if(void 0!==t)return t.exports;var n=a[e]={id:e,loaded:!1,exports:{}};return f[e].call(n.exports,n,n.exports,c),n.loaded=!0,n.exports}c.m=f,c.c=a,e=[],c.O=function(t,n,r,o){if(!n){var f=1/0;for(d=0;d<e.length;d++){n=e[d][0],r=e[d][1],o=e[d][2];for(var a=!0,i=0;i<n.length;i++)(!1&o||f>=o)&&Object.keys(c.O).every((function(e){return c.O[e](n[i])}))?n.splice(i--,1):(a=!1,o<f&&(f=o));if(a){e.splice(d--,1);var u=r();void 0!==u&&(t=u)}}return t}o=o||0;for(var d=e.length;d>0&&e[d-1][2]>o;d--)e[d]=e[d-1];e[d]=[n,r,o]},c.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return c.d(t,{a:t}),t},n=Object.getPrototypeOf?function(e){return Object.getPrototypeOf(e)}:function(e){return e.__proto__},c.t=function(e,r){if(1&r&&(e=this(e)),8&r)return e;if("object"==typeof e&&e){if(4&r&&e.__esModule)return e;if(16&r&&"function"==typeof e.then)return e}var o=Object.create(null);c.r(o);var f={};t=t||[null,n({}),n([]),n(n)];for(var a=2&r&&e;"object"==typeof a&&!~t.indexOf(a);a=n(a))Object.getOwnPropertyNames(a).forEach((function(t){f[t]=function(){return e[t]}}));return f.default=function(){return e},c.d(o,f),o},c.d=function(e,t){for(var n in t)c.o(t,n)&&!c.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},c.f={},c.e=function(e){return Promise.all(Object.keys(c.f).reduce((function(t,n){return c.f[n](e,t),t}),[]))},c.u=function(e){return"assets/js/"+({53:"935f2afb",63:"8a6052eb",94:"1bdd165f",126:"3c6c3bb0",154:"f2d2b077",195:"c4f5d8e4",278:"01df2f6c",288:"ad895e75",298:"c8229a80",350:"b5dde711",381:"501445cb",430:"7ad239b9",434:"0f1b22a8",456:"14f61f32",471:"d24847ef",494:"698581a0",514:"1be78505",625:"77ba9e12",671:"1c6b47cb",690:"f69ec364",725:"add06ab1",918:"17896441",920:"1a4e3797",940:"aa9e97dd",951:"6bbd6f71"}[e]||e)+"."+{53:"dd90fe95",63:"5fdfedd7",94:"f64ea97d",126:"b89ef05e",154:"a177a475",195:"944835d2",278:"8aa56a66",288:"fc071dca",298:"dfa70785",350:"0ae4c674",381:"d415514b",430:"092041b3",434:"355b7653",456:"c575ac59",471:"6fb8f9f6",494:"8c056572",514:"693a9378",625:"1113f68f",671:"5cc892bb",690:"b7543c30",725:"b4c2a60b",780:"54ff0f63",894:"2c392f8f",918:"45f42e8a",920:"cc685c94",940:"06009e66",945:"51b2aac9",951:"1e54c35d",972:"facdfc3b"}[e]+".js"},c.miniCssF=function(e){},c.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),c.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r={},o="react-native-testing-library-website:",c.l=function(e,t,n,f){if(r[e])r[e].push(t);else{var a,i;if(void 0!==n)for(var u=document.getElementsByTagName("script"),d=0;d<u.length;d++){var b=u[d];if(b.getAttribute("src")==e||b.getAttribute("data-webpack")==o+n){a=b;break}}a||(i=!0,(a=document.createElement("script")).charset="utf-8",a.timeout=120,c.nc&&a.setAttribute("nonce",c.nc),a.setAttribute("data-webpack",o+n),a.src=e),r[e]=[t];var l=function(t,n){a.onerror=a.onload=null,clearTimeout(s);var o=r[e];if(delete r[e],a.parentNode&&a.parentNode.removeChild(a),o&&o.forEach((function(e){return e(n)})),t)return t(n)},s=setTimeout(l.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=l.bind(null,a.onerror),a.onload=l.bind(null,a.onload),i&&document.head.appendChild(a)}},c.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},c.p="/react-native-testing-library/",c.gca=function(e){return e={17896441:"918","935f2afb":"53","8a6052eb":"63","1bdd165f":"94","3c6c3bb0":"126",f2d2b077:"154",c4f5d8e4:"195","01df2f6c":"278",ad895e75:"288",c8229a80:"298",b5dde711:"350","501445cb":"381","7ad239b9":"430","0f1b22a8":"434","14f61f32":"456",d24847ef:"471","698581a0":"494","1be78505":"514","77ba9e12":"625","1c6b47cb":"671",f69ec364:"690",add06ab1:"725","1a4e3797":"920",aa9e97dd:"940","6bbd6f71":"951"}[e]||e,c.p+c.u(e)},function(){var e={303:0,532:0};c.f.j=function(t,n){var r=c.o(e,t)?e[t]:void 0;if(0!==r)if(r)n.push(r[2]);else if(/^(303|532)$/.test(t))e[t]=0;else{var o=new Promise((function(n,o){r=e[t]=[n,o]}));n.push(r[2]=o);var f=c.p+c.u(t),a=new Error;c.l(f,(function(n){if(c.o(e,t)&&(0!==(r=e[t])&&(e[t]=void 0),r)){var o=n&&("load"===n.type?"missing":n.type),f=n&&n.target&&n.target.src;a.message="Loading chunk "+t+" failed.\n("+o+": "+f+")",a.name="ChunkLoadError",a.type=o,a.request=f,r[1](a)}}),"chunk-"+t,t)}},c.O.j=function(t){return 0===e[t]};var t=function(t,n){var r,o,f=n[0],a=n[1],i=n[2],u=0;if(f.some((function(t){return 0!==e[t]}))){for(r in a)c.o(a,r)&&(c.m[r]=a[r]);if(i)var d=i(c)}for(t&&t(n);u<f.length;u++)o=f[u],c.o(e,o)&&e[o]&&e[o][0](),e[o]=0;return c.O(d)},n=self.webpackChunkreact_native_testing_library_website=self.webpackChunkreact_native_testing_library_website||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))}()}();
!function(){"use strict";var e,t,n,r,o,f={},a={};function c(e){var t=a[e];if(void 0!==t)return t.exports;var n=a[e]={id:e,loaded:!1,exports:{}};return f[e].call(n.exports,n,n.exports,c),n.loaded=!0,n.exports}c.m=f,c.c=a,e=[],c.O=function(t,n,r,o){if(!n){var f=1/0;for(d=0;d<e.length;d++){n=e[d][0],r=e[d][1],o=e[d][2];for(var a=!0,i=0;i<n.length;i++)(!1&o||f>=o)&&Object.keys(c.O).every((function(e){return c.O[e](n[i])}))?n.splice(i--,1):(a=!1,o<f&&(f=o));if(a){e.splice(d--,1);var u=r();void 0!==u&&(t=u)}}return t}o=o||0;for(var d=e.length;d>0&&e[d-1][2]>o;d--)e[d]=e[d-1];e[d]=[n,r,o]},c.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return c.d(t,{a:t}),t},n=Object.getPrototypeOf?function(e){return Object.getPrototypeOf(e)}:function(e){return e.__proto__},c.t=function(e,r){if(1&r&&(e=this(e)),8&r)return e;if("object"==typeof e&&e){if(4&r&&e.__esModule)return e;if(16&r&&"function"==typeof e.then)return e}var o=Object.create(null);c.r(o);var f={};t=t||[null,n({}),n([]),n(n)];for(var a=2&r&&e;"object"==typeof a&&!~t.indexOf(a);a=n(a))Object.getOwnPropertyNames(a).forEach((function(t){f[t]=function(){return e[t]}}));return f.default=function(){return e},c.d(o,f),o},c.d=function(e,t){for(var n in t)c.o(t,n)&&!c.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},c.f={},c.e=function(e){return Promise.all(Object.keys(c.f).reduce((function(t,n){return c.f[n](e,t),t}),[]))},c.u=function(e){return"assets/js/"+({53:"935f2afb",63:"8a6052eb",94:"1bdd165f",126:"3c6c3bb0",154:"f2d2b077",195:"c4f5d8e4",278:"01df2f6c",288:"ad895e75",298:"c8229a80",350:"b5dde711",381:"501445cb",430:"7ad239b9",434:"0f1b22a8",456:"14f61f32",471:"d24847ef",494:"698581a0",514:"1be78505",625:"77ba9e12",671:"1c6b47cb",690:"f69ec364",725:"add06ab1",918:"17896441",920:"1a4e3797",940:"aa9e97dd",951:"6bbd6f71"}[e]||e)+"."+{53:"dd90fe95",63:"5fdfedd7",94:"f64ea97d",126:"b89ef05e",154:"a177a475",195:"944835d2",278:"8aa56a66",288:"fc071dca",298:"c8ecfbaa",350:"0ae4c674",381:"d415514b",430:"092041b3",434:"355b7653",456:"c575ac59",471:"6fb8f9f6",494:"8c056572",514:"693a9378",625:"1113f68f",671:"5cc892bb",690:"b7543c30",725:"b4c2a60b",780:"54ff0f63",894:"2c392f8f",918:"45f42e8a",920:"cc685c94",940:"06009e66",945:"51b2aac9",951:"1e54c35d",972:"facdfc3b"}[e]+".js"},c.miniCssF=function(e){},c.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),c.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r={},o="react-native-testing-library-website:",c.l=function(e,t,n,f){if(r[e])r[e].push(t);else{var a,i;if(void 0!==n)for(var u=document.getElementsByTagName("script"),d=0;d<u.length;d++){var b=u[d];if(b.getAttribute("src")==e||b.getAttribute("data-webpack")==o+n){a=b;break}}a||(i=!0,(a=document.createElement("script")).charset="utf-8",a.timeout=120,c.nc&&a.setAttribute("nonce",c.nc),a.setAttribute("data-webpack",o+n),a.src=e),r[e]=[t];var l=function(t,n){a.onerror=a.onload=null,clearTimeout(s);var o=r[e];if(delete r[e],a.parentNode&&a.parentNode.removeChild(a),o&&o.forEach((function(e){return e(n)})),t)return t(n)},s=setTimeout(l.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=l.bind(null,a.onerror),a.onload=l.bind(null,a.onload),i&&document.head.appendChild(a)}},c.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},c.p="/react-native-testing-library/",c.gca=function(e){return e={17896441:"918","935f2afb":"53","8a6052eb":"63","1bdd165f":"94","3c6c3bb0":"126",f2d2b077:"154",c4f5d8e4:"195","01df2f6c":"278",ad895e75:"288",c8229a80:"298",b5dde711:"350","501445cb":"381","7ad239b9":"430","0f1b22a8":"434","14f61f32":"456",d24847ef:"471","698581a0":"494","1be78505":"514","77ba9e12":"625","1c6b47cb":"671",f69ec364:"690",add06ab1:"725","1a4e3797":"920",aa9e97dd:"940","6bbd6f71":"951"}[e]||e,c.p+c.u(e)},function(){var e={303:0,532:0};c.f.j=function(t,n){var r=c.o(e,t)?e[t]:void 0;if(0!==r)if(r)n.push(r[2]);else if(/^(303|532)$/.test(t))e[t]=0;else{var o=new Promise((function(n,o){r=e[t]=[n,o]}));n.push(r[2]=o);var f=c.p+c.u(t),a=new Error;c.l(f,(function(n){if(c.o(e,t)&&(0!==(r=e[t])&&(e[t]=void 0),r)){var o=n&&("load"===n.type?"missing":n.type),f=n&&n.target&&n.target.src;a.message="Loading chunk "+t+" failed.\n("+o+": "+f+")",a.name="ChunkLoadError",a.type=o,a.request=f,r[1](a)}}),"chunk-"+t,t)}},c.O.j=function(t){return 0===e[t]};var t=function(t,n){var r,o,f=n[0],a=n[1],i=n[2],u=0;if(f.some((function(t){return 0!==e[t]}))){for(r in a)c.o(a,r)&&(c.m[r]=a[r]);if(i)var d=i(c)}for(t&&t(n);u<f.length;u++)o=f[u],c.o(e,o)&&e[o]&&e[o][0](),e[o]=0;return c.O(d)},n=self.webpackChunkreact_native_testing_library_website=self.webpackChunkreact_native_testing_library_website||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))}()}();
File diff suppressed because one or more lines are too long
+3 -3
View File
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+2 -2
View File
@@ -4,7 +4,7 @@
<meta charset="UTF-8">
<meta name="generator" content="Docusaurus v2.3.1">
<title data-rh="true">FAQ | React Native Testing Library</title><meta data-rh="true" name="viewport" content="width=device-width,initial-scale=1"><meta data-rh="true" name="twitter:card" content="summary_large_image"><meta data-rh="true" property="og:image" content="https://callstack.github.io/react-native-testing-library/img/owl.png"><meta data-rh="true" name="twitter:image" content="https://callstack.github.io/react-native-testing-library/img/owl.png"><meta data-rh="true" property="og:url" content="https://callstack.github.io/react-native-testing-library/docs/faq"><meta data-rh="true" name="docusaurus_locale" content="en"><meta data-rh="true" name="docsearch:language" content="en"><meta data-rh="true" name="docusaurus_version" content="current"><meta data-rh="true" name="docusaurus_tag" content="docs-default-current"><meta data-rh="true" name="docsearch:version" content="current"><meta data-rh="true" name="docsearch:docusaurus_tag" content="docs-default-current"><meta data-rh="true" property="og:title" content="FAQ | React Native Testing Library"><meta data-rh="true" name="description" content="Can I test native features of React Native apps?"><meta data-rh="true" property="og:description" content="Can I test native features of React Native apps?"><link data-rh="true" rel="icon" href="/react-native-testing-library/img/owl.png"><link data-rh="true" rel="canonical" href="https://callstack.github.io/react-native-testing-library/docs/faq"><link data-rh="true" rel="alternate" href="https://callstack.github.io/react-native-testing-library/docs/faq" hreflang="en"><link data-rh="true" rel="alternate" href="https://callstack.github.io/react-native-testing-library/docs/faq" hreflang="x-default"><link data-rh="true" rel="preconnect" href="https://6CJ0BV6AVN-dsn.algolia.net" crossorigin="anonymous"><link rel="search" type="application/opensearchdescription+xml" title="React Native Testing Library" href="/react-native-testing-library/opensearch.xml"><link rel="stylesheet" href="/react-native-testing-library/assets/css/styles.a2c05d0c.css">
<link rel="preload" href="/react-native-testing-library/assets/js/runtime~main.9c5108c1.js" as="script">
<link rel="preload" href="/react-native-testing-library/assets/js/runtime~main.e63caa38.js" as="script">
<link rel="preload" href="/react-native-testing-library/assets/js/main.0d0265df.js" as="script">
</head>
<body class="navigation-with-keyboard">
@@ -14,7 +14,7 @@ or iOS simulator/Android emulator to provision the underlying OS and platform AP
using <a href="https://reactjs.org/docs/test-renderer.html" target="_blank" rel="noopener noreferrer">React Test Renderer</a> while providing queries
and <code>fireEvent</code> APIs that mimick certain behaviors from the real runtime.</p><p>You can learn more about our testing environment <a href="/react-native-testing-library/docs/testing-env">here</a>.</p><p>This approach has certain benefits and shortfalls. On the positive side:</p><ul><li>it allows testing most of the logic of regular React Native apps</li><li>it allows running test on any OS supported by Jest, or other test runner, e.g. on CI</li><li>it uses much less resources than full runtime simulation</li><li>you can use Jest fake timers</li></ul><p>The the negative side:</p><ul><li>you cannot test native features</li><li>certain JavaScript features might not be perfectly simulated, but we are working on it</li></ul><p>For instance, <a href="https://reactnative.dev/docs/scrollview" target="_blank" rel="noopener noreferrer">react-native&#x27;s ScrollView</a> has several props that depend on native calls. While you can trigger <code>onScroll</code> call with <code>fireEvent.scroll</code>, <code>onMomentumScrollBegin</code> is called from the native side and will therefore not be called.</p></div></div></details><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Should I use/migrate to `screen` queries?</summary><div><div class="collapsibleContent_i85q"><p>There is no need to migrate existing test code to use <code>screen</code>-bases queries. You can still use
queries and other functions returned by <code>render</code>. In fact <code>screen</code> hold just that value, the latest <code>render</code> result.</p><p>For newer code you can either use <code>screen</code> or <code>render</code> result destructuring. However, there are some good reasons to use <code>screen</code>, which are described in <a href="https://kentcdodds.com/blog/common-mistakes-with-react-testing-library#not-using-screen" target="_blank" rel="noopener noreferrer">this article</a> by Kent C. Dodds.</p></div></div></details></div><footer class="theme-doc-footer docusaurus-mt-lg"><div class="theme-doc-footer-edit-meta-row row"><div class="col"><a href="https://github.com/callstack/react-native-testing-library/blob/main/website/docs/FAQ.md" target="_blank" rel="noreferrer noopener" class="theme-edit-this-page"><svg fill="currentColor" height="20" width="20" viewBox="0 0 40 40" class="iconEdit_Z9Sw" aria-hidden="true"><g><path d="m34.5 11.7l-3 3.1-6.3-6.3 3.1-3q0.5-0.5 1.2-0.5t1.1 0.5l3.9 3.9q0.5 0.4 0.5 1.1t-0.5 1.2z m-29.5 17.1l18.4-18.5 6.3 6.3-18.4 18.4h-6.3v-6.2z"></path></g></svg>Edit this page</a></div><div class="col lastUpdated_vwxv"></div></div></footer></article><nav class="pagination-nav docusaurus-mt-lg" aria-label="Docs pages navigation"><a class="pagination-nav__link pagination-nav__link--prev" href="/react-native-testing-library/docs/getting-started"><div class="pagination-nav__sublabel">Previous</div><div class="pagination-nav__label">Getting Started</div></a><a class="pagination-nav__link pagination-nav__link--next" href="/react-native-testing-library/docs/api"><div class="pagination-nav__sublabel">Next</div><div class="pagination-nav__label">API</div></a></nav></div></div></div></div></main></div></div><footer class="footer footer--dark"><div class="container container-fluid"><div class="row footer__links"><div class="col footer__col"><div class="footer__title">Docs</div><ul class="footer__items clean-list"><li class="footer__item"><a class="footer__link-item" href="/react-native-testing-library/docs/getting-started">Getting started</a></li><li class="footer__item"><a class="footer__link-item" href="/react-native-testing-library/docs/api">API</a></li></ul></div><div class="col footer__col"><div class="footer__title">Community</div><ul class="footer__items clean-list"><li class="footer__item"><a href="http://stackoverflow.com/questions/tagged/react-native-testing-library" target="_blank" rel="noopener noreferrer" class="footer__link-item">Stack Overflow<svg width="13.5" height="13.5" aria-hidden="true" viewBox="0 0 24 24" class="iconExternalLink_nPIU"><path fill="currentColor" d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"></path></svg></a></li><li class="footer__item"><a href="https://discord.gg/QbGezWe" target="_blank" rel="noopener noreferrer" class="footer__link-item">Discord Channel<svg width="13.5" height="13.5" aria-hidden="true" viewBox="0 0 24 24" class="iconExternalLink_nPIU"><path fill="currentColor" d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"></path></svg></a></li></ul></div><div class="col footer__col"><div class="footer__title">More</div><ul class="footer__items clean-list"><li class="footer__item"><a href="https://github.com/callstack/react-native-testing-library" target="_blank" rel="noopener noreferrer" class="footer__link-item">GitHub<svg width="13.5" height="13.5" aria-hidden="true" viewBox="0 0 24 24" class="iconExternalLink_nPIU"><path fill="currentColor" d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"></path></svg></a></li><li class="footer__item"><a href="https://github.com/callstack/react-native-testing-library" target="_blank" rel="noopener noreferrer" class="footer__link-item">Star<svg width="13.5" height="13.5" aria-hidden="true" viewBox="0 0 24 24" class="iconExternalLink_nPIU"><path fill="currentColor" d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"></path></svg></a></li></ul></div></div><div class="footer__bottom text--center"><div class="footer__copyright">Copyright © 2023 Callstack Open Source</div></div></div></footer></div>
<script src="/react-native-testing-library/assets/js/runtime~main.9c5108c1.js"></script>
<script src="/react-native-testing-library/assets/js/runtime~main.e63caa38.js"></script>
<script src="/react-native-testing-library/assets/js/main.0d0265df.js"></script>
</body>
</html>
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+2 -2
View File
File diff suppressed because one or more lines are too long
+2 -2
View File
File diff suppressed because one or more lines are too long
+2 -2
View File
File diff suppressed because one or more lines are too long