使用接口中的高级 Mock 脚本方式进行 mock,会出现 Method Promise.prototype.then called on incompatible receiver [object Object]。
堆栈信息如下所示
Error: Error: Method Promise.prototype.then called on incompatible receiver [object Object]
at Safeify.handleScriptResult (/yapi/vendors/node_modules/safeify/lib/Safeify.js:189:34)
at Safeify.handleScriptDone (/yapi/vendors/node_modules/safeify/lib/Safeify.js:178:14)
at Safeify.onWorkerDone (/yapi/vendors/node_modules/safeify/lib/Safeify.js:164:14)
at ChildProcess.Safeify.onWorkerMessage (/yapi/vendors/node_modules/safeify/lib/Safeify.js:55:33)
at ChildProcess.emit (events.js:310:20)
at emit (internal/child_process.js:876:12)
at processTicksAndRejections (internal/process/task_queues.js:85:21)
版本号
xuweijie1015/yapi:latest
什么问题
使用接口中的高级 Mock 脚本方式进行 mock,会出现 Method Promise.prototype.then called on incompatible receiver [object Object]。 堆栈信息如下所示
如何复现此问题
接口信息
mock 脚本
运行结果
什么浏览器
chrome
什么系统(Linux, Windows, macOS)
windows