I made a vscode extension from the github template now to test i have to run this command according to the guide
node ./node_modules/vscode/bin/test
Which install vscode to test my ext. But after it installs i get the output as
Downloading VS Code 1.54.3 into .vscode-test/vscode-1.54.3.
Downloading VS Code from: https://update.code.visualstudio.com/1.54.3/win32-archive/stable
Downloaded VS Code 1.54.3
Test error: Error: spawn E:\NewProj\glitter-ext\.vscode-test\vscode-1.54.3\Code.exe ENOENT
Exit code: -4058
Done
Failed
In this i am not sure what shall i do? My ext code is
import * as vscode from 'vscode';
export function activate(context: vscode.ExtensionContext) {
console.log('Congratulations, your extension "hello-world-vscode-extension" is now active!');
let disposable = vscode.commands.registerCommand('extension.sayHello', () => {
vscode.window.showInformationMessage('Hello World!');
});
context.subscriptions.push(disposable);
}
EDIT:
I somehow managed installing the vscode to the ./vscode-test folder. Now i wrote a test file some sort like this
const { runTests } = require('vscode-test');
const path = require('path');
async function test() {
try{
await runTests({
extensionPath: path.join(__dirname, "../dist/"),
testRunnerPath: path.join(__dirname, "../.vscode-test/"),
extensionDevelopmentPath: path.join(__dirname, "../dist/")
})
}catch(e){
console.error(e);
}
}
test();
This flile is named as test/index.js now when i run this file everything is fine and vscode opens for testing and at the same speed it gets closed and displaying the console as failed:
Exit code: 1
Done
Failed
./vscode-testor../.vscode-test/watch the.