[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"blog-cypress如果遇到測試當掉error-code-5":3},{"id":4,"slug":5,"title":6,"description":7,"content":8,"date":9,"image":10,"imageAlt":6,"author":11,"categories":14,"path":20,"minRead":21},138,"cypress如果遇到測試當掉error-code-5","[Cypress]如果遇到測試當掉(error code 5)","如果遇到測試當掉(error code 5) 由於用Cypress跑迴圈測試時遇到此問題，推測可能是記憶體爆掉 […]","\u003Ch1>如果遇到測試當掉(error code 5)\u003C\u002Fh1>\n\u003Cp>由於用Cypress跑迴圈測試時遇到此問題，推測可能是記憶體爆掉了，查了一下可以將Cypress儲存測試結果的快照關閉，請\u003Ca href=\"https:\u002F\u002Fdocs.cypress.io\u002Fguides\u002Freferences\u002Fconfiguration#Global\" title=\"參照\">參照\u003C\u002Fa>中的\u003Cem>numTestsKeptInMemory\u003C\u002Fem>設定。\u003Cbr \u002F>\n有很多人也遇到類似問題，解決方式如下：\u003Cbr \u002F>\n將cypress.json or cypress.config.json中加入”numTestsKeptInMemory”: 0。\u003C\u002Fp>\n\u003Cpre>\u003Ccode class=\"language-json\">const { defineConfig } = require(&quot;cypress&quot;);\n\nmodule.exports = defineConfig({\n  e2e: {\n    setupNodeEvents(on, config) {\n      \u002F\u002F implement node event listeners here\n    },\n    &quot;numTestsKeptInMemory&quot;: 0,\n  },\n});\u003C\u002Fcode>\u003C\u002Fpre>\n","2022-10-06T20:00:07","",{"name":12,"link":13},"Chih Fan","http:\u002F\u002Fpost.billxu.net",[15,18],{"name":16,"slug":17},"Devops","devops",{"name":19,"slug":19},"node","\u002Fblog\u002Fcypress如果遇到測試當掉error-code-5",1]