我试图为我的异步lambda编写圆顶模拟但是我收到错误' TypeError:无法存根不存在的自有属性帐户'。任何想法如何解决它?提前谢谢。
----测试
import { handler } from 'handler'
describe('tests', function() {
const sbox = sandbox.create()
describe('a payload is sent', () => {
it('should return a 200', (done) => {
const thePayload = thedata;
sbox.stub(handler, 'handler').resolves(thePayload)
account(context, context, (err, resp) => {
expect(resp.statusCode).to.eq(200)
done()
})
})
})
})
---- handler
export const handler = async (event, context, callback) => {
return callback(null, { statusCode: 200 } )
}