Skip to content

Commit

Permalink
Test remoteName and extensionKind (for #76028)
Browse files Browse the repository at this point in the history
  • Loading branch information
aeschli committed Jun 25, 2019
1 parent 5d37d79 commit 75fed40
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion extensions/vscode-api-tests/src/singlefolder-tests/env.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*--------------------------------------------------------------------------------------------*/

import * as assert from 'assert';
import { env } from 'vscode';
import { env, extensions, ExtensionKind } from 'vscode';

suite('env-namespace', () => {

Expand All @@ -24,4 +24,22 @@ suite('env-namespace', () => {
assert.throws(() => (env as any).sessionId = '234');
});

test('env.remoteName', function () {
const remoteName = env.remoteName;
const apiTestExtension = extensions.getExtension('vscode.vscode-api-tests');
const testResolverExtension = extensions.getExtension('vscode.vscode-test-resolver');
if (typeof remoteName === 'undefined') {
assert.ok(apiTestExtension);
assert.ok(testResolverExtension);
assert.equal(ExtensionKind.UI, apiTestExtension!.extensionKind);
assert.equal(ExtensionKind.UI, testResolverExtension!.extensionKind);
} else if (typeof remoteName === 'string') {
assert.ok(apiTestExtension);
assert.ok(!testResolverExtension); // we currently can only access extensions that run on same host
assert.equal(ExtensionKind.Workspace, apiTestExtension!.extensionKind);
} else {
assert.fail();
}
});

});

0 comments on commit 75fed40

Please sign in to comment.