W7DKXA4IZ7NCYOOTFFSW2CNUMU7Q2NS4J3EVIDXBR35LSBISQVRAC import * as path from 'path';import * as Mocha from 'mocha';import * as glob from 'glob';export function run(): Promise<void> {// Create the mocha testconst mocha = new Mocha({ui: 'tdd',color: true});const testsRoot = path.resolve(__dirname, '..');return new Promise((c, e) => {glob('**/**.test.js', { cwd: testsRoot }, (err, files) => {if (err) {return e(err);}// Add files to the test suitefiles.forEach(f => mocha.addFile(path.resolve(testsRoot, f)));try {// Run the mocha testmocha.run(failures => {if (failures > 0) {e(new Error(`${failures} tests failed.`));} else {c();}});} catch (err) {console.error(err);e(err);}});});}
import * as assert from 'assert';// You can import and use all API from the 'vscode' module// as well as import your extension to test itimport * as vscode from 'vscode';// import * as myExtension from '../../extension';suite('Extension Test Suite', () => {vscode.window.showInformationMessage('Start all tests.');test('Sample test', () => {assert.strictEqual(-1, [1, 2, 3].indexOf(5));assert.strictEqual(-1, [1, 2, 3].indexOf(0));});});
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, '../../');// The path to test runner// Passed to --extensionTestsPathconst extensionTestsPath = path.resolve(__dirname, './suite/index');// Download VS Code, unzip it and run the integration testawait runTests({ extensionDevelopmentPath, extensionTestsPath });} catch (err) {console.error('Failed to run tests');process.exit(1);}}main();
// The module 'vscode' contains the VS Code extensibility API// Import the module and reference it with the alias vscode in your code belowimport * as vscode from 'vscode';// this method is called when your extension is activated// your extension is activated the very first time the command is executedexport function activate(context: vscode.ExtensionContext) {// Use the console to output diagnostic information (console.log) and errors (console.error)// This line of code will only be executed once when your extension is activatedconsole.log('Congratulations, your extension "pijul" is now active!');// The command has been defined in the package.json file// Now provide the implementation of the command with registerCommand// The commandId parameter must match the command field in package.jsonlet disposable = vscode.commands.registerCommand('pijul.helloWorld', () => {// The code you place here will be executed every time your command is executed// Display a message box to the uservscode.window.showInformationMessage('Hello World from pijul!');});context.subscriptions.push(disposable);}// this method is called when your extension is deactivatedexport function deactivate() {}