Add Azure Function Service Error/Cancel tests (#19758)

* cleanup tests

* exit/error scenario tests

* remove + from manuallyEnterObjectName

* address comments

* add resolve for writeFile
This commit is contained in:
Vasu Bhog
2022-06-20 15:48:38 -07:00
committed by GitHub
parent 0aadd317fa
commit c5093dbb5a
8 changed files with 151 additions and 39 deletions

View File

@@ -71,7 +71,7 @@ describe('Add SQL Binding quick pick', () => {
quickpickStub.onCall(3).resolves((constants.connectionProfile) as any);
quickpickStub.onCall(4).resolves((constants.yesString) as any);
// setLocalAppSetting fails if we dont set writeFile stub
sinon.stub(fs.promises, 'writeFile');
sinon.stub(fs.promises, 'writeFile').resolves();
sinon.stub(azureFunctionUtils, 'setLocalAppSetting').withArgs(sinon.match.any, 'sqlConnectionString', 'testConnectionString1').resolves((true));
sinon.stub(utils, 'executeCommand').resolves('downloaded nuget package');
quickpickStub.onCall(5).resolves(('testDb') as any);
@@ -124,7 +124,7 @@ describe('Add SQL Binding quick pick', () => {
quickpickStub.onCall(3).resolves((constants.connectionProfile) as any);
quickpickStub.onCall(4).resolves((constants.yesString) as any);
// setLocalAppSetting fails if we dont set writeFile stub
sinon.stub(fs.promises, 'writeFile');
sinon.stub(fs.promises, 'writeFile').resolves();
sinon.stub(azureFunctionUtils, 'setLocalAppSetting').withArgs(sinon.match.any, 'sqlConnectionString', 'testConnectionString2').resolves((true));
sinon.stub(utils, 'executeCommand').resolves('downloaded nuget package');
quickpickStub.onCall(5).resolves(('testDb') as any);