Skip to content

Commit 17b8908

Browse files
committed
fix: Use sync APIs to create folder and write on file to avoid unexpected behavior
1 parent a979a00 commit 17b8908

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

clients/cobol-lsp-vscode-extension/src/__tests__/CopybookResolveURITest.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ SettingsUtils.getWorkspacesURI = jest.fn().mockReturnValue(["file://" + __dirnam
2727

2828
// file utils
2929
function createFile(filename: string): string {
30-
fs.writeFile(path.join(folderPath, filename), "Some dummy content", err => {
30+
fs.writeFileSync(path.join(folderPath, filename), "Some dummy content", err => {
3131
if (err) {
3232
return null;
3333
}
@@ -36,7 +36,8 @@ function createFile(filename: string): string {
3636
}
3737

3838
function createDirectory(targetPath: string) {
39-
fs.promises.mkdir(targetPath, {recursive: true}).catch(console.error);
39+
40+
fs.mkdirSync(targetPath, {recursive: true});
4041
}
4142

4243
function removeFolder(pathFile: string) {

0 commit comments

Comments
 (0)