1. <legend id='iUSMT'><style id='iUSMT'><dir id='iUSMT'><q id='iUSMT'></q></dir></style></legend><tfoot id='iUSMT'></tfoot>
  2. <i id='iUSMT'><tr id='iUSMT'><dt id='iUSMT'><q id='iUSMT'><span id='iUSMT'><b id='iUSMT'><form id='iUSMT'><ins id='iUSMT'></ins><ul id='iUSMT'></ul><sub id='iUSMT'></sub></form><legend id='iUSMT'></legend><bdo id='iUSMT'><pre id='iUSMT'><center id='iUSMT'></center></pre></bdo></b><th id='iUSMT'></th></span></q></dt></tr></i><div id='iUSMT'><tfoot id='iUSMT'></tfoot><dl id='iUSMT'><fieldset id='iUSMT'></fieldset></dl></div>
      <bdo id='iUSMT'></bdo><ul id='iUSMT'></ul>

    1. <small id='iUSMT'></small><noframes id='iUSMT'>

      错误:无法读取属性提取.使用 jest-expo 和 react native

      时间:2023-11-29

          <small id='omPct'></small><noframes id='omPct'>

          • <bdo id='omPct'></bdo><ul id='omPct'></ul>
          • <tfoot id='omPct'></tfoot>
              <tbody id='omPct'></tbody>

                <i id='omPct'><tr id='omPct'><dt id='omPct'><q id='omPct'><span id='omPct'><b id='omPct'><form id='omPct'><ins id='omPct'></ins><ul id='omPct'></ul><sub id='omPct'></sub></form><legend id='omPct'></legend><bdo id='omPct'><pre id='omPct'><center id='omPct'></center></pre></bdo></b><th id='omPct'></th></span></q></dt></tr></i><div id='omPct'><tfoot id='omPct'></tfoot><dl id='omPct'><fieldset id='omPct'></fieldset></dl></div>
                <legend id='omPct'><style id='omPct'><dir id='omPct'><q id='omPct'></q></dir></style></legend>

                本文介绍了错误:无法读取属性提取.使用 jest-expo 和 react native的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                TypeError:无法读取未定义的获取"属性

                TypeError: Cannot read property 'fetch' of undefined

                  at node_modules/whatwg-fetch/fetch.js:4:8
                  at Object.<anonymous> (node_modules/whatwg-fetch/fetch.js:466:3)
                  at Object.<anonymous> (node_modules/jest-expo/src/setup.js:97:348)
                

                使用 jest-expo 运行测试时出错.如果有人有解决方案,请分享.

                Got error while running tests with jest-expo. If anyone have solution please share.

                推荐答案

                显然这是没有代码片段的猜测,但是看当时 fetch.js 的样子,undefined 值,其 fetch 属性是变量 self (参见第 1 行),它被设置为 this 上下文(参见第 466 行).

                Obviously this is a guess without a code snippet, but looking at what fetch.js looked like at the time, the undefined value whose fetch property we can't read is the variable self (see line 1), which was meant to be set to the this context (see line 466).

                因此,似乎 fetch.js 期望在 this 引用 window 的环境中运行,但 jest-expo,作为一个测试工具,正在其他一些环境中运行它,可能是在 thisundefined 的严格模式下.

                Therefore, it seems that fetch.js is expecting to run in an environment where this refers to the window, but jest-expo, being a testing tool, is running it in some other environment, probably in strict mode where this is undefined.

                这篇关于错误:无法读取属性提取.使用 jest-expo 和 react native的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  <tbody id='4Hdfs'></tbody>

                <small id='4Hdfs'></small><noframes id='4Hdfs'>

                <i id='4Hdfs'><tr id='4Hdfs'><dt id='4Hdfs'><q id='4Hdfs'><span id='4Hdfs'><b id='4Hdfs'><form id='4Hdfs'><ins id='4Hdfs'></ins><ul id='4Hdfs'></ul><sub id='4Hdfs'></sub></form><legend id='4Hdfs'></legend><bdo id='4Hdfs'><pre id='4Hdfs'><center id='4Hdfs'></center></pre></bdo></b><th id='4Hdfs'></th></span></q></dt></tr></i><div id='4Hdfs'><tfoot id='4Hdfs'></tfoot><dl id='4Hdfs'><fieldset id='4Hdfs'></fieldset></dl></div>

                  <tfoot id='4Hdfs'></tfoot>
                  • <bdo id='4Hdfs'></bdo><ul id='4Hdfs'></ul>
                    • <legend id='4Hdfs'><style id='4Hdfs'><dir id='4Hdfs'><q id='4Hdfs'></q></dir></style></legend>