我正在尝试创建一个简单的类来包装用于dynamodb的Amazon SDK。在测试时,我得到以下错误: TypeError: this.dynamodb.batchGetItem is not a function 下面是我的测试用例: test.js import DynamoDBContentAccess= jest.fn().mockImplementation(() => { return {
batchGetItem: batchGetItemPromise,
我正在尝试编写一个测试,它使用默认设置的请求承诺的模拟实现。在我的代码中,我需要使用const request = require('request-promise').defaults({ jar: true });请求const> Promise.resolve(JSON.stringify(someVar)));
// This returns the error 'TypeError: request is n
我正在为对star war api swapi.dev的一个简单调用编写测试,只是学习一些异步测试。但是,我得到了以下错误TypeError: swapi.getCharacters is not a functionconst fetch = require('node-fetch}; console.error(error.message);};
这是我的</e