mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-14 01:25:37 -05:00
Un-skip and fix a few of the db projects tests (#13726)
* Un-skip and fix a few of the db projects tests * Addressed comments * Fix one test failure on Linux/Mac
This commit is contained in:
@@ -8,20 +8,25 @@ import * as os from 'os';
|
||||
import * as fs from 'fs';
|
||||
import * as path from 'path';
|
||||
import * as vscode from 'vscode';
|
||||
import * as sinon from 'sinon';
|
||||
import { NetCoreTool, DBProjectConfigurationKey, NetCoreInstallLocationKey, NextCoreNonWindowsDefaultPath } from '../tools/netcoreTool';
|
||||
import { getQuotedPath } from '../common/utils';
|
||||
import { isNullOrUndefined } from 'util';
|
||||
import { generateTestFolderPath } from './testUtils';
|
||||
|
||||
describe.skip('NetCoreTool: Net core tests', function (): void {
|
||||
describe('NetCoreTool: Net core tests', function (): void {
|
||||
afterEach(function (): void {
|
||||
sinon.restore();
|
||||
});
|
||||
|
||||
it('Should override dotnet default value with settings', async function (): Promise<void> {
|
||||
try {
|
||||
// update settings and validate
|
||||
await vscode.workspace.getConfiguration(DBProjectConfigurationKey).update(NetCoreInstallLocationKey, 'test value path', true);
|
||||
const netcoreTool = new NetCoreTool();
|
||||
sinon.stub(netcoreTool, 'showInstallDialog').returns(Promise.resolve());
|
||||
should(netcoreTool.netcoreInstallLocation).equal('test value path'); // the path in settings should be taken
|
||||
should(netcoreTool.findOrInstallNetCore()).equal(false); // dotnet can not be present at dummy path in settings
|
||||
should(await netcoreTool.findOrInstallNetCore()).equal(false); // dotnet can not be present at dummy path in settings
|
||||
}
|
||||
finally {
|
||||
// clean again
|
||||
@@ -29,9 +34,10 @@ describe.skip('NetCoreTool: Net core tests', function (): void {
|
||||
}
|
||||
});
|
||||
|
||||
it('Should find right dotnet default paths', function (): void {
|
||||
it('Should find right dotnet default paths', async function (): Promise<void> {
|
||||
const netcoreTool = new NetCoreTool();
|
||||
netcoreTool.findOrInstallNetCore();
|
||||
sinon.stub(netcoreTool, 'showInstallDialog').returns(Promise.resolve());
|
||||
await netcoreTool.findOrInstallNetCore();
|
||||
|
||||
if (os.platform() === 'win32') {
|
||||
// check that path should start with c:\program files
|
||||
|
||||
Reference in New Issue
Block a user