Skip to content

Commit

Permalink
improve test error logging
Browse files Browse the repository at this point in the history
  • Loading branch information
peterbom committed Nov 2, 2023
1 parent fae6364 commit 60a3d44
Showing 1 changed file with 20 additions and 16 deletions.
36 changes: 20 additions & 16 deletions src/tests/runTests.ts
Original file line number Diff line number Diff line change
@@ -1,22 +1,26 @@
import * as path from 'path';
import { runTests } from '@vscode/test-electron';

async function main() {
try {
// The folder containing the Extension Manifest package.json
// Passed to `--extensionDevelopmentPath`
const extensionDevelopmentPath = path.resolve(__dirname, '../../');
async function main() {
try {
// The folder containing the Extension Manifest package.json
// Passed to `--extensionDevelopmentPath`
const extensionDevelopmentPath = path.resolve(__dirname, '../../');

// The path to test runner
// Passed to --extensionTestsPath
const extensionTestsPath = path.resolve(__dirname, './suite/index');
// The path to test runner
// Passed to --extensionTestsPath
const extensionTestsPath = path.resolve(__dirname, './suite/index');

// Download VS Code, unzip it and run the integration test
await runTests({ extensionDevelopmentPath, extensionTestsPath });
} catch (err) {
console.error('Failed to run tests');
process.exit(1);
}
}
// Download VS Code, unzip it and run the integration test
await runTests({ extensionDevelopmentPath, extensionTestsPath });
} catch (err) {
console.error(`Failed to run tests:\n${err}`);
console.log(`message: ${(err as any)?.message}`);
console.log(`name: ${(err as any)?.name}`);
console.log(`stack: ${(err as any)?.stack}`);
console.log(`cause: ${(err as any)?.cause}`);
process.exit(1);
}
}

main();
main();

0 comments on commit 60a3d44

Please sign in to comment.