Skip to content

Commit 51441ba

Browse files
committed
Improve test-logging
1 parent 079b5e5 commit 51441ba

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

test/suite/extension.test.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,11 @@ function getExtensionLogContent(): string | undefined {
5252
}
5353

5454
async function deleteFiles(dir: vscode.Uri, keepDirs: vscode.Uri[], pred?: (fileType: string) => boolean) {
55+
const dirContents = await vscode.workspace.fs.readDirectory(dir);
56+
console.log(`Looking at ${dir} contents: ${dirContents}`);
5557
if (keepDirs.findIndex((val) => val.path === dir.path) !== -1) {
5658
console.log(`Keeping ${dir}`);
5759
} else {
58-
const dirContents = await vscode.workspace.fs.readDirectory(dir);
59-
console.log(`Deleting ${dir} contents: ${dirContents}`);
6060
dirContents.forEach(async ([name, type]) => {
6161
const uri: vscode.Uri = joinUri(dir, name);
6262
if (type === vscode.FileType.File) {
@@ -76,6 +76,7 @@ async function deleteFiles(dir: vscode.Uri, keepDirs: vscode.Uri[], pred?: (file
7676
const isEmptyNow = await vscode.workspace.fs.readDirectory(subDirectory)
7777
.then((contents) => Promise.resolve(contents.length === 0));
7878
if (isEmptyNow) {
79+
console.log(`Deleting ${subDirectory}`);
7980
await vscode.workspace.fs.delete(subDirectory, {
8081
recursive: true,
8182
useTrash: false,

0 commit comments

Comments
 (0)