title: Sinon.restore not working for stubbing and testing AWS functions
body: <p>So I'm trying to write a few tests for testing an AWS wrapper library that I have been writing.
  The tests are running individually without any issues, but won't all run as one 'describe' block.</p>
  <pre><code>const AWS_REGION = 'eu-west-2';
  
  const aws = require('aws-sdk');
  const chai = require('chai');
  const expect = chai.expect;
  const sinon = require('sinon');
  const sinonChai = require('sinon-chai');
  chai.use(sinonChai);
  
  // These help:
  // https://stackoverflow.com/questions/26243647/sinon-stub-in-node-with-aws-sdk
  // https://stackoverflow.com/questions/61516053/sinon-stub-for-lambda-using-promises
  describe('SQS Utilities Test', () =&gt; {
  
    afterEach(() =&gt; {
      sinon.restore();
    });
  
    it('should add to SQS', async () =&gt; {
      sinon.stub(aws.config, 'update');
  
      const sqs = {
        sendMessage: sinon.stub().returnsThis(),
        promise: sinon.stub()
      };
      sinon.stub(aws, 'SQS').callsFake(() =&gt; sqs);
  
      // these use the above stubbed version of aws
      const AWSUtilities = require('../index').AWSUtilities;
      const awsUtilities = new AWSUtilities(AWS_REGION);
      const response = await awsUtilities.postToSQS('https://example.com', { id: 1}, 'chicken');
  
      expect(sqs.sendMessage).to.have.been.calledOnce;
    });
  
    it('should get from SQS', async () =&gt; {
      sinon.stub(aws.config, 'update');
  
      const sqs = {
        receiveMessage: sinon.stub().returnsThis(),
        promise: sinon.stub()
      };
      sinon.stub(aws, 'SQS').callsFake(() =&gt; sqs);
  
      // these use the above stubbed version of aws
      const AWSUtilities = require('../index').AWSUtilities;
      const awsUtilities = new AWSUtilities(AWS_REGION);
  
      const response = await awsUtilities.getFromSQS('https://example.com');
      expect(sqs.receiveMessage).to.have.been.calledOnce;
    });
  
  ...
  </code></pre>
  <p>What I noticed, is that in the second test, the error I am getting is <code>sqs.receiveMessage is not a function</code>, which means that the second test is using the <code>sqs</code> object from the first test (I can further verify this as the error changes if I add <code>receiveMessage</code> to the first test <code>sqs</code> object).</p>
  <p>Is this a bug in sinon restore, or have I written something incorrectly? Here is the whole library: <a href="https://github.com/unegma/aws-utilities/blob/main/test/SQSTests.spec.js" rel="nofollow noreferrer">https://github.com/unegma/aws-utilities/blob/main/test/SQSTests.spec.js</a></p>