mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-14 01:25:37 -05:00
* 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>
22 lines
1.1 KiB
TypeScript
22 lines
1.1 KiB
TypeScript
/*---------------------------------------------------------------------------------------------
|
|
* 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');
|
|
});
|
|
});
|