我正在尝试验证我是否为 SNS 的服务 ctor 提供了正确的参数,但我不知道该怎么做。
现在,我确实知道如何验证发布,但我再次尝试验证对 SNS 功能/ctor 的期望。
这是一些伪代码:
//code
const AWS = require('aws-sdk');
const SNS = new AWS.SNS({bobby:'no'});
//test
const AWSmock = require('aws-sdk-mock');
describe('something', () => {
beforeAll(()=>{
AWSmock.mock('SNS','publish', Promise.resolve());
});
test('doing it', () => {
const f = require('file');
expect(AWSmock.SNS.calledWith({})).toEqual(true); //this example would be false, but I can't figure out how to reference the SNS method here
});
});