mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
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:
19
extensions/import/src/test/services/serviceClient.test.ts
Normal file
19
extensions/import/src/test/services/serviceClient.test.ts
Normal 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');
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user