Additional tests for import extension (#10953)

* Setting up tests on import extension

* -Added API wrappers for all the azdata and vscode APIs to make them easily mockable
-Added some unit tests for the import extension
-Some code logic separations

* -added code report for the import extension in ci

* changes code coverage to 36%

* adding some comments

* Removing unnecessary exports

* -refactored test code to replicate src structure
-some changes mentioned in the pr

* removed unnecessary prefixes from test case name
This commit is contained in:
Aasim Khan
2020-06-25 19:22:25 -07:00
committed by GitHub
parent cdd3d1bf2a
commit fb52760be1
8 changed files with 578 additions and 226 deletions

View File

@@ -0,0 +1,19 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { ensure } from '../../services/serviceUtils';
import * as should from 'should';
describe('Service utitlities test', function () {
it('ensure returns empty object if property not found ', function () {
// ensure will return an empty object when key is not found
should(ensure({ 'testkey1': 'testval' }, 'testkey')).deepEqual({});
});
it('ensure returns property value if it is present in target', function () {
// when property is present it will return the value
should(ensure({ 'testkey': 'testval' }, 'testkey')).equal('testval');
});
});