mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-29 17:23:25 -05:00
Telemetry for Data Workspaces extension (#13846)
* Add CodeQL Analysis workflow (#10195) * Add CodeQL Analysis workflow * Fix path * test commit pls ignore * telemetry points * yarn lock changes * making test xplat friendly * PR feedback * Adding additional telemetry points Co-authored-by: Justin Hutchings <jhutchings1@users.noreply.github.com>
This commit is contained in:
21
extensions/data-workspace/src/test/utils.test.ts
Normal file
21
extensions/data-workspace/src/test/utils.test.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import 'mocha';
|
||||
import * as os from 'os';
|
||||
import * as path from 'path';
|
||||
import should = require('should');
|
||||
import { calculateRelativity } from '../common/telemetry';
|
||||
|
||||
suite('Utilities Tests', function (): void {
|
||||
test('test CalculateRelativity', async () => {
|
||||
const root = os.platform() === 'win32' ? 'Z:\\' : '/';
|
||||
const workspacePath = path.join(root, 'Source', 'Workspace', 'qwerty.code-workspace');
|
||||
|
||||
should.equal(calculateRelativity(path.join(root, 'Source', 'Workspace', 'qwerty.sqlproj'), workspacePath), 'sameFolder');
|
||||
should.equal(calculateRelativity(path.join(root, 'Source', 'Workspace', 'qwerty', 'asdfg', 'qwerty.sqlproj'), workspacePath), 'directAncestor');
|
||||
should.equal(calculateRelativity(path.join(root, 'Users', 'BillG', 'qwerty.sqlproj'), workspacePath), 'other');
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user