mirror of
https://github.com/coder/code-server.git
synced 2026-05-06 12:31:58 +02:00
chore(vscode): update to 1.54.2
This commit is contained in:
@@ -2,46 +2,47 @@
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import * as assert from 'assert';
|
||||
import * as Platform from 'vs/platform/registry/common/platform';
|
||||
import * as Types from 'vs/base/common/types';
|
||||
import { Registry } from 'vs/platform/registry/common/platform';
|
||||
import { isFunction } from 'vs/base/common/types';
|
||||
|
||||
suite('Platform / Registry', () => {
|
||||
|
||||
test('registry - api', function () {
|
||||
assert.ok(Types.isFunction(Platform.Registry.add));
|
||||
assert.ok(Types.isFunction(Platform.Registry.as));
|
||||
assert.ok(Types.isFunction(Platform.Registry.knows));
|
||||
assert.ok(isFunction(Registry.add));
|
||||
assert.ok(isFunction(Registry.as));
|
||||
assert.ok(isFunction(Registry.knows));
|
||||
});
|
||||
|
||||
test('registry - mixin', function () {
|
||||
|
||||
Platform.Registry.add('foo', { bar: true });
|
||||
Registry.add('foo', { bar: true });
|
||||
|
||||
assert.ok(Platform.Registry.knows('foo'));
|
||||
assert.ok(Platform.Registry.as<any>('foo').bar);
|
||||
assert.equal(Platform.Registry.as<any>('foo').bar, true);
|
||||
assert.ok(Registry.knows('foo'));
|
||||
assert.ok(Registry.as<any>('foo').bar);
|
||||
assert.equal(Registry.as<any>('foo').bar, true);
|
||||
});
|
||||
|
||||
test('registry - knows, as', function () {
|
||||
|
||||
let ext = {};
|
||||
|
||||
Platform.Registry.add('knows,as', ext);
|
||||
Registry.add('knows,as', ext);
|
||||
|
||||
assert.ok(Platform.Registry.knows('knows,as'));
|
||||
assert.ok(!Platform.Registry.knows('knows,as1234'));
|
||||
assert.ok(Registry.knows('knows,as'));
|
||||
assert.ok(!Registry.knows('knows,as1234'));
|
||||
|
||||
assert.ok(Platform.Registry.as('knows,as') === ext);
|
||||
assert.ok(Platform.Registry.as('knows,as1234') === null);
|
||||
assert.ok(Registry.as('knows,as') === ext);
|
||||
assert.ok(Registry.as('knows,as1234') === null);
|
||||
});
|
||||
|
||||
test('registry - mixin, fails on duplicate ids', function () {
|
||||
|
||||
Platform.Registry.add('foo-dup', { bar: true });
|
||||
Registry.add('foo-dup', { bar: true });
|
||||
|
||||
try {
|
||||
Platform.Registry.add('foo-dup', { bar: false });
|
||||
Registry.add('foo-dup', { bar: false });
|
||||
assert.ok(false);
|
||||
} catch (e) {
|
||||
assert.ok(true);
|
||||
|
||||
Reference in New Issue
Block a user