Skip to content

Commit

Permalink
fix: server module loading broken after rename. e2e tests not install…
Browse files Browse the repository at this point in the history
…ing dependencies
  • Loading branch information
Oliver Paraskos committed Nov 23, 2023
1 parent da3e467 commit 233c530
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
2 changes: 1 addition & 1 deletion client/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ let client: LanguageClient;
export function activate(context: ExtensionContext) {
// The server is implemented in node
const serverModule = context.asAbsolutePath(
path.join('server', 'dist', 'main.js')
path.join('server', 'dist', 'bundle.cjs.js')
);
// The debug options for the server
// --inspect=6009: runs the server in Node's Inspector mode so VS Code can attach to the server for debugging
Expand Down
16 changes: 13 additions & 3 deletions client/test/runTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
*--------------------------------------------------------------------------------------------*/
import * as path from 'path';

import { runTests } from '@vscode/test-electron';
import { downloadAndUnzipVSCode, resolveCliArgsFromVSCodeExecutablePath, runTests } from '@vscode/test-electron';
import { spawnSync } from 'child_process';

async function main() {
try {
Expand All @@ -16,8 +17,17 @@ async function main() {
// Passed to --extensionTestsPath
const extensionTestsPath = path.resolve(__dirname, './index');

// Download VS Code, unzip it and run the integration test
await runTests({ extensionDevelopmentPath, extensionTestsPath });
const vscodeExecutablePath = await downloadAndUnzipVSCode();
const [cli, ...args] = resolveCliArgsFromVSCodeExecutablePath(vscodeExecutablePath);
spawnSync(cli, [...args, '--install-extension', 'redhat.vscode-yaml'], {
encoding: 'utf-8',
stdio: 'inherit',
});
await runTests({
vscodeExecutablePath,
extensionDevelopmentPath,
extensionTestsPath,
});
} catch (err) {
console.error('Failed to run tests');
process.exit(1);
Expand Down
2 changes: 1 addition & 1 deletion server
Submodule server updated 2 files
+7 −0 CHANGELOG.md
+1 −1 package.json

0 comments on commit 233c530

Please sign in to comment.