Skip to content

Commit 5e71ebc

Browse files
committed
Fix tests
1 parent 6dc8edc commit 5e71ebc

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

test/suite/extension.test.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ suite('Extension Test Suite', () => {
124124
vscode.window.showInformationMessage('Start all tests.');
125125

126126
suiteSetup(async () => {
127+
const tmpdir = path.join(getWorkspaceRoot().uri.fsPath, 'tmp');
127128
await deleteWorkspaceFiles(
128129
[ joinUri(getWorkspaceRoot().uri, '.vscode')
129130
, joinUri(getWorkspaceRoot().uri, 'bin', process.platform === 'win32' ? 'ghcup' : '.ghcup', 'cache')
@@ -135,14 +136,16 @@ suite('Extension Test Suite', () => {
135136
await getHaskellConfig().update('releasesDownloadStoragePath', path.normalize(getWorkspaceFile('bin').fsPath));
136137
await getHaskellConfig().update('serverEnvironment', {
137138
XDG_CACHE_HOME: path.normalize(getWorkspaceFile('cache-test').fsPath),
139+
TMPDIR: tmpdir
138140
});
141+
fs.mkdirSync(tmpdir, { recursive: true });
139142
const contents = new TextEncoder().encode('main = putStrLn "hi vscode tests"');
140143
await vscode.workspace.fs.writeFile(getWorkspaceFile('Main.hs'), contents);
141144

142145
const pred = (uri: vscode.Uri) => !['download', 'gz', 'zip'].includes(path.extname(uri.fsPath));
143146
// Setting up watchers before actual tests start, to ensure we will got the created event
144-
filesCreated.set('wrapper', existsWorkspaceFile(`bin/hls-*/haskell-language-server-wrapper*`, pred));
145-
filesCreated.set('server', existsWorkspaceFile(`bin/hls-*/haskell-language-server-[1-9]*`, pred));
147+
filesCreated.set('wrapper', existsWorkspaceFile(`tmp/ghcup-*/haskell-language-server-wrapper*`, pred));
148+
filesCreated.set('server', existsWorkspaceFile(`tmp/ghcup-*/haskell-language-server-[1-9]*`, pred));
146149
filesCreated.set('log', existsWorkspaceFile('hls.log'));
147150
filesCreated.set('cache', existsWorkspaceFile('cache-test'));
148151
});

0 commit comments

Comments
 (0)