Skip to content

Commit

Permalink
Add server-cli smoke test
Browse files Browse the repository at this point in the history
  • Loading branch information
jeanp413 committed Sep 4, 2021
1 parent 8b6e403 commit 8e0cd66
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion test/smoke/src/areas/terminal/terminal.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
*--------------------------------------------------------------------------------------------*/

import minimist = require('minimist');
import { Application } from '../../../../automation';
import * as path from 'path';
import { Application, Quality } from '../../../../automation';
import { afterSuite, beforeSuite } from '../../utils';

export function setup(opts: minimist.ParsedArgs) {
Expand All @@ -18,5 +19,23 @@ export function setup(opts: minimist.ParsedArgs) {
await app.workbench.terminal.runCommand('ls');
await app.workbench.terminal.waitForTerminalText(lines => lines.some(l => l.includes('app.js')));
});

it('shows terminal and runs cli command', async function () {
const app = this.app as Application;

if (app.quality !== Quality.Dev) {
this.skip();
}

const rootPath = process.env['VSCODE_REPOSITORY'];
if (!rootPath) {
throw new Error('VSCODE_REPOSITORY env variable not found');
}

const cliPath = path.join(rootPath, 'out', 'server-cli.js');

await app.workbench.terminal.runCommand(`node ${cliPath} app.js`);
await app.workbench.editors.waitForActiveTab('app.js');
});
});
}

0 comments on commit 8e0cd66

Please sign in to comment.