pmi*_*nda 5 es6-promise jestjs
我在运行所有测试时遇到此错误(当我直接加载所涉及的函数的唯一测试时,没有错误)
\nnode:internal/process/promises:246\n triggerUncaughtException(err, true /* fromPromise */);\n ^\n\n[UnhandledPromiseRejection: This error originated either by throwing inside of an async function without a catch block,\nor by rejecting a promise which was not handled with .catch(). The promise rejected with the reason\n"Error: Ha ocurrido un error, por favor intente de nuevo m\xc3\xa1s tarde".] {\n code: 'ERR_UNHANDLED_REJECTION'\n}\nRun Code Online (Sandbox Code Playgroud)\n生成错误的函数的代码块如下所示:
\nasync getMonthRequests(rut, month) {\n try {\n // some code, in the test I'm testing that it fails\n } catch (error) {\n return Promise.reject('Ha ocurrido un error, por favor intente de nuevo m\xc3\xa1s tarde');\n }\n}\nRun Code Online (Sandbox Code Playgroud)\n任何想法?
\n| 归档时间: |
|
| 查看次数: |
5647 次 |
| 最近记录: |