mirror of
https://github.com/serverless/serverless.git
synced 2026-01-18 14:58:43 +00:00
correctly stub userStats.track
This commit is contained in:
parent
743f165451
commit
705a51867d
@ -847,7 +847,7 @@ describe('AwsProvider', () => {
|
||||
const AwsProviderProxyquired = proxyquire('./awsProvider.js', {
|
||||
'aws-sdk': awsStub,
|
||||
});
|
||||
sinon.stub(userStats, 'track');
|
||||
let trackStub
|
||||
|
||||
// add environment variables here if you want them cleared prior to your test and restored
|
||||
// after it has completed. Any environment variable that might alter credentials loading
|
||||
@ -882,6 +882,7 @@ describe('AwsProvider', () => {
|
||||
let originalEnvironmentVariables;
|
||||
|
||||
beforeEach(() => {
|
||||
trackStub = sinon.stub(userStats, 'track');
|
||||
originalProviderCredentials = serverless.service.provider.credentials;
|
||||
originalProviderProfile = serverless.service.provider.profile;
|
||||
originalEnvironmentVariables = replaceEnv(relevantEnvironment);
|
||||
@ -908,6 +909,7 @@ describe('AwsProvider', () => {
|
||||
replaceEnv(originalEnvironmentVariables);
|
||||
serverless.service.provider.profile = originalProviderProfile;
|
||||
serverless.service.provider.credentials = originalProviderCredentials;
|
||||
trackStub.restore();
|
||||
});
|
||||
|
||||
it('should set region for credentials', () => {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user