我正在为对star war api swapi.dev的一个简单调用编写测试,只是学习一些异步测试。但是,我得到了以下错误TypeError: swapi.getCharacters is not a functionconst fetch = require('node-fetch"test", "main": "index.js",
"license
我正在尝试编写一个测试,它使用默认设置的请求承诺的模拟实现。request.mockImplementation(() => Promise.resolve(JSON.stringify(someVar)));
// This returns the error 'TypeError: "request-p