Skip to content

Commit 4e65473

Browse files
committed
Fix configuration target scope and empty dir
1 parent 787d714 commit 4e65473

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

test/getPreLaunchTaskChain.test.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,31 +3,34 @@
33
* Licensed under the MIT License. See License.txt in the project root for license information.
44
*--------------------------------------------------------------------------------------------*/
55

6+
import { AzExtFsExtra } from '@microsoft/vscode-azext-utils';
67
import * as assert from 'assert';
78
import * as vscode from 'vscode';
89
import { getPreLaunchTaskChain } from '../src/debug/getPreLaunchTaskChain';
910
import type { ITask } from '../src/vsCodeConfig/tasks';
1011
import { getTestWorkspaceFolder } from './global.test';
1112

12-
suite('getPreLaunchTaskChain', () => {
13+
suite.only('getPreLaunchTaskChain', () => {
1314
let workspaceFolder: vscode.WorkspaceFolder;
1415

15-
suiteSetup(function (): void {
16+
suiteSetup(async function (): Promise<void> {
1617
const testPath = getTestWorkspaceFolder();
1718
const folders = vscode.workspace.workspaceFolders;
1819
const folder = folders?.find(f => f.uri.fsPath === testPath);
1920
if (!folder) {
2021
throw new Error(`Could not find workspace folder for path: ${testPath}`);
2122
}
23+
24+
await AzExtFsExtra.emptyDir(workspaceFolder.uri.fsPath);
2225
workspaceFolder = folder;
2326
});
2427

2528
async function setTasks(tasks: ITask[]): Promise<void> {
26-
await vscode.workspace.getConfiguration('tasks', workspaceFolder.uri).update('tasks', tasks);
29+
await vscode.workspace.getConfiguration('tasks', workspaceFolder.uri).update('tasks', tasks, vscode.ConfigurationTarget.WorkspaceFolder);
2730
}
2831

2932
teardown(async () => {
30-
await vscode.workspace.getConfiguration('tasks', workspaceFolder.uri).update('tasks', undefined);
33+
await AzExtFsExtra.emptyDir(workspaceFolder.uri.fsPath);
3134
});
3235

3336
test('returns only the preLaunchTask when it has no dependencies', async () => {

0 commit comments

Comments
 (0)