dwyl / aws-sdk-mock

:rainbow: AWSomocks for Javascript/Node.js aws-sdk tested, documented & maintained. Contributions welcome!
Apache License 2.0
1.09k stars 107 forks source link

APIGateway Methods Fail to Mock #75

Open wongJonathan opened 7 years ago

wongJonathan commented 7 years ago

Hi I've been trying to mock some APIGatway Methods but for some reason it still seems to be going through to AWS.

My code: In my index.js:

clearDomainName() {
        return this.apigateway.deleteDomainName({domainName: this.givenDomainName}).promise();
}

In my index.test.js:

it('Delete the domain name', function () {
        AWS.mock('APIGateway', 'deleteDomainName', testDomainData);
        plugin.clearDomainName().then(function (data) {
            console.log(data);
            done();
        }).catch(done);
    });

Error that I receive:

     UnknownEndpoint: Inaccessible host: `apigateway.us-moon-1.amazonaws.com'. This service may not be available in the `us-moon-1' region.

Showing that the method was not mocked and things are going through to aws.

Am I doing something wrong or is this function not supported?

Thanks for the help!

wongJonathan commented 7 years ago

Any help? The only thing I can think would be on my part would be spelling and I'm pretty sure I spelled it right otherwise it would give me an error.