gpt4 book ai didi

node.js - 如何重置/恢复到原始生成

转载 作者:太空宇宙 更新时间:2023-11-04 00:15:40 24 4
gpt4 key购买 nike

我正在尝试使用 mock-spawn 模拟生成过程模块。由于我无法恢复模拟,后续测试失败。

我尝试使用mySpawn.resotre(),但没有这样的函数。我检查了代码仍然无法弄清楚。

任何人都可以帮我解决这个问题吗?

最佳答案

我有类似的要求,这是来自mock-spawn贡献者的评论

You can simply require('child_process').spawn if you need the original back. If you have overridden that, you should save the original before and reset the child_process spawn property to the saved original.

引用号:https://github.com/gotwarlost/mock-spawn/issues/13#issuecomment-342589086

关于node.js - 如何重置/恢复到原始生成,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47195001/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com