Skip to content

Commit

Permalink
clean up test workspace before running tests
Browse files Browse the repository at this point in the history
  • Loading branch information
riccardoferretti committed Aug 17, 2023
1 parent fc2fb6a commit 5a049ca
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion packages/foam-vscode/src/test/run-tests.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import rf from 'rimraf';
import path from 'path';
import { runTests } from 'vscode-test';
import { runUnit } from './suite-unit';
Expand Down Expand Up @@ -34,12 +35,21 @@ async function main() {
// Passed to --extensionTestsPath
const extensionTestsPath = path.join(__dirname, 'suite');

const testWorkspace = path.join(
extensionDevelopmentPath,
'.test-workspace'
);
// clean test workspace
rf.sync(path.join(testWorkspace, '*'));
rf.sync(path.join(testWorkspace, '.vscode'));
rf.sync(path.join(testWorkspace, '.foam'));

// Download VS Code, unzip it and run the integration test
await runTests({
extensionDevelopmentPath,
extensionTestsPath,
launchArgs: [
path.join(extensionDevelopmentPath, '.test-workspace'),
testWorkspace,
'--disable-extensions',
'--disable-workspace-trust',
],
Expand Down

0 comments on commit 5a049ca

Please sign in to comment.