mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-04-01 01:20:31 -04:00
Vscode merge (#4582)
* Merge from vscode 37cb23d3dd4f9433d56d4ba5ea3203580719a0bd * fix issues with merges * bump node version in azpipe * replace license headers * remove duplicate launch task * fix build errors * fix build errors * fix tslint issues * working through package and linux build issues * more work * wip * fix packaged builds * working through linux build errors * wip * wip * wip * fix mac and linux file limits * iterate linux pipeline * disable editor typing * revert series to parallel * remove optimize vscode from linux * fix linting issues * revert testing change * add work round for new node * readd packaging for extensions * fix issue with angular not resolving decorator dependencies
This commit is contained in:
@@ -0,0 +1,149 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import * as assert from 'assert';
|
||||
import { Query } from 'vs/workbench/contrib/extensions/common/extensionQuery';
|
||||
|
||||
suite('Extension query', () => {
|
||||
test('parse', () => {
|
||||
let query = Query.parse('');
|
||||
assert.equal(query.value, '');
|
||||
assert.equal(query.sortBy, '');
|
||||
|
||||
query = Query.parse('hello');
|
||||
assert.equal(query.value, 'hello');
|
||||
assert.equal(query.sortBy, '');
|
||||
|
||||
query = Query.parse(' hello world ');
|
||||
assert.equal(query.value, 'hello world');
|
||||
assert.equal(query.sortBy, '');
|
||||
|
||||
query = Query.parse('@sort');
|
||||
assert.equal(query.value, '@sort');
|
||||
assert.equal(query.sortBy, '');
|
||||
|
||||
query = Query.parse('@sort:');
|
||||
assert.equal(query.value, '@sort:');
|
||||
assert.equal(query.sortBy, '');
|
||||
|
||||
query = Query.parse(' @sort: ');
|
||||
assert.equal(query.value, '@sort:');
|
||||
assert.equal(query.sortBy, '');
|
||||
|
||||
query = Query.parse('@sort:installs');
|
||||
assert.equal(query.value, '');
|
||||
assert.equal(query.sortBy, 'installs');
|
||||
|
||||
query = Query.parse(' @sort:installs ');
|
||||
assert.equal(query.value, '');
|
||||
assert.equal(query.sortBy, 'installs');
|
||||
|
||||
query = Query.parse('@sort:installs-');
|
||||
assert.equal(query.value, '');
|
||||
assert.equal(query.sortBy, 'installs');
|
||||
|
||||
query = Query.parse('@sort:installs-foo');
|
||||
assert.equal(query.value, '');
|
||||
assert.equal(query.sortBy, 'installs');
|
||||
|
||||
query = Query.parse('@sort:installs');
|
||||
assert.equal(query.value, '');
|
||||
assert.equal(query.sortBy, 'installs');
|
||||
|
||||
query = Query.parse('@sort:installs');
|
||||
assert.equal(query.value, '');
|
||||
assert.equal(query.sortBy, 'installs');
|
||||
|
||||
query = Query.parse('vs @sort:installs');
|
||||
assert.equal(query.value, 'vs');
|
||||
assert.equal(query.sortBy, 'installs');
|
||||
|
||||
query = Query.parse('vs @sort:installs code');
|
||||
assert.equal(query.value, 'vs code');
|
||||
assert.equal(query.sortBy, 'installs');
|
||||
|
||||
query = Query.parse('@sort:installs @sort:ratings');
|
||||
assert.equal(query.value, '');
|
||||
assert.equal(query.sortBy, 'ratings');
|
||||
});
|
||||
|
||||
test('toString', () => {
|
||||
let query = new Query('hello', '', '');
|
||||
assert.equal(query.toString(), 'hello');
|
||||
|
||||
query = new Query('hello world', '', '');
|
||||
assert.equal(query.toString(), 'hello world');
|
||||
|
||||
query = new Query(' hello ', '', '');
|
||||
assert.equal(query.toString(), 'hello');
|
||||
|
||||
query = new Query('', 'installs', '');
|
||||
assert.equal(query.toString(), '@sort:installs');
|
||||
|
||||
query = new Query('', 'installs', '');
|
||||
assert.equal(query.toString(), '@sort:installs');
|
||||
|
||||
query = new Query('', 'installs', '');
|
||||
assert.equal(query.toString(), '@sort:installs');
|
||||
|
||||
query = new Query('hello', 'installs', '');
|
||||
assert.equal(query.toString(), 'hello @sort:installs');
|
||||
|
||||
query = new Query(' hello ', 'installs', '');
|
||||
assert.equal(query.toString(), 'hello @sort:installs');
|
||||
});
|
||||
|
||||
test('isValid', () => {
|
||||
let query = new Query('hello', '', '');
|
||||
assert(query.isValid());
|
||||
|
||||
query = new Query('hello world', '', '');
|
||||
assert(query.isValid());
|
||||
|
||||
query = new Query(' hello ', '', '');
|
||||
assert(query.isValid());
|
||||
|
||||
query = new Query('', 'installs', '');
|
||||
assert(query.isValid());
|
||||
|
||||
query = new Query('', 'installs', '');
|
||||
assert(query.isValid());
|
||||
|
||||
query = new Query('', 'installs', '');
|
||||
assert(query.isValid());
|
||||
|
||||
query = new Query('', 'installs', '');
|
||||
assert(query.isValid());
|
||||
|
||||
query = new Query('hello', 'installs', '');
|
||||
assert(query.isValid());
|
||||
|
||||
query = new Query(' hello ', 'installs', '');
|
||||
assert(query.isValid());
|
||||
});
|
||||
|
||||
test('equals', () => {
|
||||
let query1 = new Query('hello', '', '');
|
||||
let query2 = new Query('hello', '', '');
|
||||
assert(query1.equals(query2));
|
||||
|
||||
query2 = new Query('hello world', '', '');
|
||||
assert(!query1.equals(query2));
|
||||
|
||||
query2 = new Query('hello', 'installs', '');
|
||||
assert(!query1.equals(query2));
|
||||
|
||||
query2 = new Query('hello', 'installs', '');
|
||||
assert(!query1.equals(query2));
|
||||
});
|
||||
|
||||
test('autocomplete', () => {
|
||||
Query.suggestions('@sort:in').some(x => x === '@sort:installs ');
|
||||
Query.suggestions('@sort:installs').every(x => x !== '@sort:rating ');
|
||||
|
||||
Query.suggestions('@category:blah').some(x => x === '@category:"extension packs" ');
|
||||
Query.suggestions('@category:"extension packs"').every(x => x !== '@category:formatters ');
|
||||
});
|
||||
});
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,170 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import * as sinon from 'sinon';
|
||||
import * as assert from 'assert';
|
||||
import * as path from 'vs/base/common/path';
|
||||
import * as fs from 'fs';
|
||||
import * as os from 'os';
|
||||
import * as uuid from 'vs/base/common/uuid';
|
||||
import {
|
||||
IExtensionGalleryService, IGalleryExtensionAssets, IGalleryExtension, IExtensionManagementService,
|
||||
IExtensionEnablementService, DidInstallExtensionEvent, DidUninstallExtensionEvent, InstallExtensionEvent, IExtensionIdentifier
|
||||
} from 'vs/platform/extensionManagement/common/extensionManagement';
|
||||
import { ExtensionTipsService } from 'vs/workbench/contrib/extensions/electron-browser/extensionTipsService';
|
||||
import { ExtensionGalleryService } from 'vs/platform/extensionManagement/node/extensionGalleryService';
|
||||
import { TestInstantiationService } from 'vs/platform/instantiation/test/common/instantiationServiceMock';
|
||||
import { Emitter } from 'vs/base/common/event';
|
||||
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
|
||||
import { NullTelemetryService } from 'vs/platform/telemetry/common/telemetryUtils';
|
||||
import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace';
|
||||
import { TestTextResourceConfigurationService, TestContextService, TestLifecycleService, TestEnvironmentService, TestStorageService, TestSharedProcessService } from 'vs/workbench/test/workbenchTestServices';
|
||||
import { TestNotificationService } from 'vs/platform/notification/test/common/testNotificationService';
|
||||
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
import { testWorkspace } from 'vs/platform/workspace/test/common/testWorkspace';
|
||||
import { IFileService } from 'vs/platform/files/common/files';
|
||||
import { FileService } from 'vs/workbench/services/files/node/fileService';
|
||||
import * as extfs from 'vs/base/node/extfs';
|
||||
import { TestConfigurationService } from 'vs/platform/configuration/test/common/testConfigurationService';
|
||||
import { IPager } from 'vs/base/common/paging';
|
||||
import { assign } from 'vs/base/common/objects';
|
||||
import { getGalleryExtensionId } from 'vs/platform/extensionManagement/common/extensionManagementUtil';
|
||||
import { IEnvironmentService } from 'vs/platform/environment/common/environment';
|
||||
import { ConfigurationKey } from 'vs/workbench/contrib/extensions/common/extensions';
|
||||
import { ExtensionManagementService } from 'vs/platform/extensionManagement/node/extensionManagementService';
|
||||
import { TestExtensionEnablementService } from 'vs/platform/extensionManagement/test/electron-browser/extensionEnablementService.test';
|
||||
import { IURLService } from 'vs/platform/url/common/url';
|
||||
import product from 'vs/platform/product/node/product';
|
||||
import { ITextModel } from 'vs/editor/common/model';
|
||||
import { IModelService } from 'vs/editor/common/services/modelService';
|
||||
import { ILifecycleService } from 'vs/platform/lifecycle/common/lifecycle';
|
||||
import { INotificationService, Severity, IPromptChoice, IPromptOptions } from 'vs/platform/notification/common/notification';
|
||||
import { URLService } from 'vs/platform/url/common/urlService';
|
||||
import { IExperimentService } from 'vs/workbench/contrib/experiments/node/experimentService';
|
||||
import { TestExperimentService } from 'vs/workbench/contrib/experiments/test/electron-browser/experimentService.test';
|
||||
import { IStorageService, StorageScope } from 'vs/platform/storage/common/storage';
|
||||
import { ExtensionType } from 'vs/platform/extensions/common/extensions';
|
||||
import { ISharedProcessService } from 'vs/platform/ipc/electron-browser/sharedProcessService';
|
||||
|
||||
const mockExtensionGallery: IGalleryExtension[] = [
|
||||
aGalleryExtension('MockExtension1', {
|
||||
displayName: 'Mock Extension 1',
|
||||
version: '1.5',
|
||||
publisherId: 'mockPublisher1Id',
|
||||
publisher: 'mockPublisher1',
|
||||
publisherDisplayName: 'Mock Publisher 1',
|
||||
description: 'Mock Description',
|
||||
installCount: 1000,
|
||||
rating: 4,
|
||||
ratingCount: 100
|
||||
}, {
|
||||
dependencies: ['pub.1'],
|
||||
}, {
|
||||
manifest: { uri: 'uri:manifest', fallbackUri: 'fallback:manifest' },
|
||||
readme: { uri: 'uri:readme', fallbackUri: 'fallback:readme' },
|
||||
changelog: { uri: 'uri:changelog', fallbackUri: 'fallback:changlog' },
|
||||
download: { uri: 'uri:download', fallbackUri: 'fallback:download' },
|
||||
icon: { uri: 'uri:icon', fallbackUri: 'fallback:icon' },
|
||||
license: { uri: 'uri:license', fallbackUri: 'fallback:license' },
|
||||
repository: { uri: 'uri:repository', fallbackUri: 'fallback:repository' },
|
||||
coreTranslations: {}
|
||||
}),
|
||||
aGalleryExtension('MockExtension2', {
|
||||
displayName: 'Mock Extension 2',
|
||||
version: '1.5',
|
||||
publisherId: 'mockPublisher2Id',
|
||||
publisher: 'mockPublisher2',
|
||||
publisherDisplayName: 'Mock Publisher 2',
|
||||
description: 'Mock Description',
|
||||
installCount: 1000,
|
||||
rating: 4,
|
||||
ratingCount: 100
|
||||
}, {
|
||||
dependencies: ['pub.1', 'pub.2'],
|
||||
}, {
|
||||
manifest: { uri: 'uri:manifest', fallbackUri: 'fallback:manifest' },
|
||||
readme: { uri: 'uri:readme', fallbackUri: 'fallback:readme' },
|
||||
changelog: { uri: 'uri:changelog', fallbackUri: 'fallback:changlog' },
|
||||
download: { uri: 'uri:download', fallbackUri: 'fallback:download' },
|
||||
icon: { uri: 'uri:icon', fallbackUri: 'fallback:icon' },
|
||||
license: { uri: 'uri:license', fallbackUri: 'fallback:license' },
|
||||
repository: { uri: 'uri:repository', fallbackUri: 'fallback:repository' },
|
||||
coreTranslations: {}
|
||||
})
|
||||
];
|
||||
|
||||
const mockExtensionLocal = [
|
||||
{
|
||||
type: ExtensionType.User,
|
||||
identifier: mockExtensionGallery[0].identifier,
|
||||
manifest: {
|
||||
name: mockExtensionGallery[0].name,
|
||||
publisher: mockExtensionGallery[0].publisher,
|
||||
version: mockExtensionGallery[0].version
|
||||
},
|
||||
metadata: null,
|
||||
path: 'somepath',
|
||||
readmeUrl: 'some readmeUrl',
|
||||
changelogUrl: 'some changelogUrl'
|
||||
},
|
||||
{
|
||||
type: ExtensionType.User,
|
||||
identifier: mockExtensionGallery[1].identifier,
|
||||
manifest: {
|
||||
name: mockExtensionGallery[1].name,
|
||||
publisher: mockExtensionGallery[1].publisher,
|
||||
version: mockExtensionGallery[1].version
|
||||
},
|
||||
metadata: null,
|
||||
path: 'somepath',
|
||||
readmeUrl: 'some readmeUrl',
|
||||
changelogUrl: 'some changelogUrl'
|
||||
}
|
||||
];
|
||||
|
||||
const mockTestData = {
|
||||
recommendedExtensions: [
|
||||
'mockPublisher1.mockExtension1',
|
||||
'MOCKPUBLISHER2.mockextension2',
|
||||
'badlyformattedextension',
|
||||
'MOCKPUBLISHER2.mockextension2',
|
||||
'unknown.extension'
|
||||
],
|
||||
validRecommendedExtensions: [
|
||||
'mockPublisher1.mockExtension1',
|
||||
'MOCKPUBLISHER2.mockextension2'
|
||||
]
|
||||
};
|
||||
|
||||
function aPage<T>(...objects: T[]): IPager<T> {
|
||||
return { firstPage: objects, total: objects.length, pageSize: objects.length, getPage: () => null! };
|
||||
}
|
||||
|
||||
const noAssets: IGalleryExtensionAssets = {
|
||||
changelog: null,
|
||||
download: null!,
|
||||
icon: null!,
|
||||
license: null,
|
||||
manifest: null,
|
||||
readme: null,
|
||||
repository: null,
|
||||
coreTranslations: null!
|
||||
};
|
||||
|
||||
function aGalleryExtension(name: string, properties: any = {}, galleryExtensionProperties: any = {}, assets: IGalleryExtensionAssets = noAssets): IGalleryExtension {
|
||||
const galleryExtension = <IGalleryExtension>Object.create({});
|
||||
assign(galleryExtension, { name, publisher: 'pub', version: '1.0.0', properties: {}, assets: {} }, properties);
|
||||
assign(galleryExtension.properties, { dependencies: [] }, galleryExtensionProperties);
|
||||
assign(galleryExtension.assets, assets);
|
||||
galleryExtension.identifier = { id: getGalleryExtensionId(galleryExtension.publisher, galleryExtension.name), uuid: uuid.generateUuid() };
|
||||
return <IGalleryExtension>galleryExtension;
|
||||
}
|
||||
|
||||
// {{SQL CARBON EDIT}} disable broken tests
|
||||
suite('ExtensionsTipsService Test', () => {
|
||||
test('ExtensionTipsService: No Prompt for valid workspace recommendations when galleryService is absent', () => {
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,527 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import * as assert from 'assert';
|
||||
import { assign } from 'vs/base/common/objects';
|
||||
import { generateUuid } from 'vs/base/common/uuid';
|
||||
import { ExtensionsListView } from 'vs/workbench/contrib/extensions/electron-browser/extensionsViews';
|
||||
import { TestInstantiationService } from 'vs/platform/instantiation/test/common/instantiationServiceMock';
|
||||
import { IExtensionsWorkbenchService } from 'vs/workbench/contrib/extensions/common/extensions';
|
||||
import { ExtensionsWorkbenchService } from 'vs/workbench/contrib/extensions/node/extensionsWorkbenchService';
|
||||
import {
|
||||
IExtensionManagementService, IExtensionGalleryService, IExtensionEnablementService, IExtensionTipsService, ILocalExtension, IGalleryExtension, IQueryOptions,
|
||||
DidInstallExtensionEvent, DidUninstallExtensionEvent, InstallExtensionEvent, IExtensionIdentifier, IExtensionManagementServerService, IExtensionManagementServer, EnablementState, ExtensionRecommendationReason, SortBy
|
||||
} from 'vs/platform/extensionManagement/common/extensionManagement';
|
||||
import { getGalleryExtensionId } from 'vs/platform/extensionManagement/common/extensionManagementUtil';
|
||||
import { ExtensionManagementService } from 'vs/platform/extensionManagement/node/extensionManagementService';
|
||||
import { ExtensionTipsService } from 'vs/workbench/contrib/extensions/electron-browser/extensionTipsService';
|
||||
import { TestExtensionEnablementService } from 'vs/platform/extensionManagement/test/electron-browser/extensionEnablementService.test';
|
||||
import { ExtensionGalleryService } from 'vs/platform/extensionManagement/node/extensionGalleryService';
|
||||
import { IURLService } from 'vs/platform/url/common/url';
|
||||
import { Emitter } from 'vs/base/common/event';
|
||||
import { IPager } from 'vs/base/common/paging';
|
||||
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
|
||||
import { NullTelemetryService } from 'vs/platform/telemetry/common/telemetryUtils';
|
||||
import { IExtensionService } from 'vs/workbench/services/extensions/common/extensions';
|
||||
import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace';
|
||||
import { TestContextService, TestWindowService, TestSharedProcessService } from 'vs/workbench/test/workbenchTestServices';
|
||||
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
||||
import { ILogService, NullLogService } from 'vs/platform/log/common/log';
|
||||
import { IWindowService } from 'vs/platform/windows/common/windows';
|
||||
import { URLService } from 'vs/platform/url/common/urlService';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
import { TestConfigurationService } from 'vs/platform/configuration/test/common/testConfigurationService';
|
||||
import { SinonStub } from 'sinon';
|
||||
import { IExperimentService, ExperimentService, ExperimentState, ExperimentActionType } from 'vs/workbench/contrib/experiments/node/experimentService';
|
||||
import { IRemoteAgentService } from 'vs/workbench/services/remote/common/remoteAgentService';
|
||||
import { RemoteAgentService } from 'vs/workbench/services/remote/electron-browser/remoteAgentServiceImpl';
|
||||
import { ExtensionManagementServerService } from 'vs/workbench/services/extensions/electron-browser/extensionManagementServerService';
|
||||
import { ExtensionIdentifier, ExtensionType } from 'vs/platform/extensions/common/extensions';
|
||||
import { ISharedProcessService } from 'vs/platform/ipc/electron-browser/sharedProcessService';
|
||||
|
||||
|
||||
suite('ExtensionsListView Tests', () => {
|
||||
|
||||
let instantiationService: TestInstantiationService;
|
||||
let testableView: ExtensionsListView;
|
||||
let installEvent: Emitter<InstallExtensionEvent>,
|
||||
didInstallEvent: Emitter<DidInstallExtensionEvent>,
|
||||
uninstallEvent: Emitter<IExtensionIdentifier>,
|
||||
didUninstallEvent: Emitter<DidUninstallExtensionEvent>;
|
||||
|
||||
const localEnabledTheme = aLocalExtension('first-enabled-extension', { categories: ['Themes', 'random'] });
|
||||
const localEnabledLanguage = aLocalExtension('second-enabled-extension', { categories: ['Programming languages'] });
|
||||
const localDisabledTheme = aLocalExtension('first-disabled-extension', { categories: ['themes'] });
|
||||
const localDisabledLanguage = aLocalExtension('second-disabled-extension', { categories: ['programming languages'] });
|
||||
const localRandom = aLocalExtension('random-enabled-extension', { categories: ['random'] });
|
||||
const builtInTheme = aLocalExtension('my-theme', { contributes: { themes: ['my-theme'] } }, { type: ExtensionType.System });
|
||||
const builtInBasic = aLocalExtension('my-lang', { contributes: { grammars: [{ language: 'my-language' }] } }, { type: ExtensionType.System });
|
||||
|
||||
const workspaceRecommendationA = aGalleryExtension('workspace-recommendation-A');
|
||||
const workspaceRecommendationB = aGalleryExtension('workspace-recommendation-B');
|
||||
const fileBasedRecommendationA = aGalleryExtension('filebased-recommendation-A');
|
||||
const fileBasedRecommendationB = aGalleryExtension('filebased-recommendation-B');
|
||||
const otherRecommendationA = aGalleryExtension('other-recommendation-A');
|
||||
|
||||
suiteSetup(() => {
|
||||
installEvent = new Emitter<InstallExtensionEvent>();
|
||||
didInstallEvent = new Emitter<DidInstallExtensionEvent>();
|
||||
uninstallEvent = new Emitter<IExtensionIdentifier>();
|
||||
didUninstallEvent = new Emitter<DidUninstallExtensionEvent>();
|
||||
|
||||
instantiationService = new TestInstantiationService();
|
||||
instantiationService.stub(ITelemetryService, NullTelemetryService);
|
||||
instantiationService.stub(ILogService, NullLogService);
|
||||
instantiationService.stub(IWindowService, TestWindowService);
|
||||
|
||||
instantiationService.stub(IWorkspaceContextService, new TestContextService());
|
||||
instantiationService.stub(IConfigurationService, new TestConfigurationService());
|
||||
|
||||
instantiationService.stub(IExtensionGalleryService, ExtensionGalleryService);
|
||||
instantiationService.stub(ISharedProcessService, TestSharedProcessService);
|
||||
instantiationService.stub(IExperimentService, ExperimentService);
|
||||
|
||||
instantiationService.stub(IExtensionManagementService, ExtensionManagementService);
|
||||
instantiationService.stub(IExtensionManagementService, 'onInstallExtension', installEvent.event);
|
||||
instantiationService.stub(IExtensionManagementService, 'onDidInstallExtension', didInstallEvent.event);
|
||||
instantiationService.stub(IExtensionManagementService, 'onUninstallExtension', uninstallEvent.event);
|
||||
instantiationService.stub(IExtensionManagementService, 'onDidUninstallExtension', didUninstallEvent.event);
|
||||
instantiationService.stub(IRemoteAgentService, RemoteAgentService);
|
||||
|
||||
instantiationService.stub(IExtensionManagementServerService, instantiationService.createInstance(ExtensionManagementServerService, <IExtensionManagementServer>{ authority: 'vscode-local', extensionManagementService: instantiationService.get(IExtensionManagementService), label: 'local' }));
|
||||
|
||||
instantiationService.stub(IExtensionEnablementService, new TestExtensionEnablementService(instantiationService));
|
||||
|
||||
instantiationService.stub(IExtensionTipsService, ExtensionTipsService);
|
||||
instantiationService.stub(IURLService, URLService);
|
||||
|
||||
instantiationService.stubPromise(IExtensionTipsService, 'getWorkspaceRecommendations', [
|
||||
{ extensionId: workspaceRecommendationA.identifier.id },
|
||||
{ extensionId: workspaceRecommendationB.identifier.id }]);
|
||||
instantiationService.stub(IExtensionTipsService, 'getFileBasedRecommendations', [
|
||||
{ extensionId: fileBasedRecommendationA.identifier.id },
|
||||
{ extensionId: fileBasedRecommendationB.identifier.id }]);
|
||||
instantiationService.stubPromise(IExtensionTipsService, 'getOtherRecommendations', [
|
||||
{ extensionId: otherRecommendationA.identifier.id }
|
||||
]);
|
||||
const reasons = {};
|
||||
reasons[workspaceRecommendationA.identifier.id] = { reasonId: ExtensionRecommendationReason.Workspace };
|
||||
reasons[workspaceRecommendationB.identifier.id] = { reasonId: ExtensionRecommendationReason.Workspace };
|
||||
reasons[fileBasedRecommendationA.identifier.id] = { reasonId: ExtensionRecommendationReason.File };
|
||||
reasons[fileBasedRecommendationB.identifier.id] = { reasonId: ExtensionRecommendationReason.File };
|
||||
reasons[otherRecommendationA.identifier.id] = { reasonId: ExtensionRecommendationReason.Executable };
|
||||
|
||||
instantiationService.stub(IExtensionTipsService, 'getAllRecommendationsWithReason', reasons);
|
||||
|
||||
});
|
||||
|
||||
setup(async () => {
|
||||
instantiationService.stubPromise(IExtensionManagementService, 'getInstalled', [localEnabledTheme, localEnabledLanguage, localRandom, localDisabledTheme, localDisabledLanguage, builtInTheme, builtInBasic]);
|
||||
instantiationService.stubPromise(IExtensionManagementService, 'getExtensionsReport', []);
|
||||
instantiationService.stubPromise(IExtensionGalleryService, 'query', aPage());
|
||||
instantiationService.stubPromise(IExperimentService, 'getExperimentsByType', []);
|
||||
|
||||
instantiationService.stub(IExtensionService, {
|
||||
getExtensions: () => {
|
||||
return Promise.resolve([
|
||||
{ identifier: new ExtensionIdentifier(localEnabledTheme.identifier.id) },
|
||||
{ identifier: new ExtensionIdentifier(localEnabledLanguage.identifier.id) },
|
||||
{ identifier: new ExtensionIdentifier(localRandom.identifier.id) },
|
||||
{ identifier: new ExtensionIdentifier(builtInTheme.identifier.id) },
|
||||
{ identifier: new ExtensionIdentifier(builtInBasic.identifier.id) }
|
||||
]);
|
||||
}
|
||||
});
|
||||
await (<TestExtensionEnablementService>instantiationService.get(IExtensionEnablementService)).setEnablement([localDisabledTheme], EnablementState.Disabled);
|
||||
await (<TestExtensionEnablementService>instantiationService.get(IExtensionEnablementService)).setEnablement([localDisabledLanguage], EnablementState.Disabled);
|
||||
|
||||
instantiationService.set(IExtensionsWorkbenchService, instantiationService.createInstance(ExtensionsWorkbenchService));
|
||||
testableView = instantiationService.createInstance(ExtensionsListView, {});
|
||||
});
|
||||
|
||||
teardown(() => {
|
||||
(<ExtensionsWorkbenchService>instantiationService.get(IExtensionsWorkbenchService)).dispose();
|
||||
testableView.dispose();
|
||||
});
|
||||
|
||||
test('Test query types', () => {
|
||||
assert.equal(ExtensionsListView.isBuiltInExtensionsQuery('@builtin'), true);
|
||||
assert.equal(ExtensionsListView.isInstalledExtensionsQuery('@installed'), true);
|
||||
assert.equal(ExtensionsListView.isInstalledExtensionsQuery('@enabled'), true);
|
||||
assert.equal(ExtensionsListView.isInstalledExtensionsQuery('@disabled'), true);
|
||||
assert.equal(ExtensionsListView.isInstalledExtensionsQuery('@outdated'), true);
|
||||
assert.equal(ExtensionsListView.isInstalledExtensionsQuery('@installed searchText'), true);
|
||||
assert.equal(ExtensionsListView.isInstalledExtensionsQuery('@enabled searchText'), true);
|
||||
assert.equal(ExtensionsListView.isInstalledExtensionsQuery('@disabled searchText'), true);
|
||||
assert.equal(ExtensionsListView.isInstalledExtensionsQuery('@outdated searchText'), true);
|
||||
});
|
||||
|
||||
test('Test empty query equates to sort by install count', () => {
|
||||
const target = <SinonStub>instantiationService.stubPromise(IExtensionGalleryService, 'query', aPage());
|
||||
return testableView.show('').then(() => {
|
||||
assert.ok(target.calledOnce);
|
||||
const options: IQueryOptions = target.args[0][0];
|
||||
assert.equal(options.sortBy, SortBy.InstallCount);
|
||||
});
|
||||
});
|
||||
|
||||
test('Test non empty query without sort doesnt use sortBy', () => {
|
||||
const target = <SinonStub>instantiationService.stubPromise(IExtensionGalleryService, 'query', aPage());
|
||||
return testableView.show('some extension').then(() => {
|
||||
assert.ok(target.calledOnce);
|
||||
const options: IQueryOptions = target.args[0][0];
|
||||
assert.equal(options.sortBy, undefined);
|
||||
});
|
||||
});
|
||||
|
||||
test('Test query with sort uses sortBy', () => {
|
||||
const target = <SinonStub>instantiationService.stubPromise(IExtensionGalleryService, 'query', aPage());
|
||||
return testableView.show('some extension @sort:rating').then(() => {
|
||||
assert.ok(target.calledOnce);
|
||||
const options: IQueryOptions = target.args[0][0];
|
||||
assert.equal(options.sortBy, SortBy.WeightedRating);
|
||||
});
|
||||
});
|
||||
|
||||
test('Test installed query results', () => {
|
||||
const allInstalledCheck = testableView.show('@installed').then(result => {
|
||||
assert.equal(result.length, 5, 'Unexpected number of results for @installed query');
|
||||
const actual = [result.get(0).name, result.get(1).name, result.get(2).name, result.get(3).name, result.get(4).name].sort();
|
||||
const expected = [localDisabledTheme.manifest.name, localEnabledTheme.manifest.name, localRandom.manifest.name, localDisabledLanguage.manifest.name, localEnabledLanguage.manifest.name];
|
||||
for (let i = 0; i < result.length; i++) {
|
||||
assert.equal(actual[i], expected[i], 'Unexpected extension for @installed query.');
|
||||
}
|
||||
});
|
||||
|
||||
const installedCheck = testableView.show('@installed first').then(result => {
|
||||
assert.equal(result.length, 2, 'Unexpected number of results for @installed query');
|
||||
assert.equal(result.get(0).name, localDisabledTheme.manifest.name, 'Unexpected extension for @installed query with search text.');
|
||||
assert.equal(result.get(1).name, localEnabledTheme.manifest.name, 'Unexpected extension for @installed query with search text.');
|
||||
});
|
||||
|
||||
const allDisabledCheck = testableView.show('@disabled').then(result => {
|
||||
assert.equal(result.length, 2, 'Unexpected number of results for @disabled query');
|
||||
assert.equal(result.get(0).name, localDisabledTheme.manifest.name, 'Unexpected extension for @disabled query.');
|
||||
assert.equal(result.get(1).name, localDisabledLanguage.manifest.name, 'Unexpected extension for @disabled query.');
|
||||
});
|
||||
|
||||
const allEnabledCheck = testableView.show('@enabled').then(result => {
|
||||
assert.equal(result.length, 3, 'Unexpected number of results for @enabled query');
|
||||
assert.equal(result.get(0).name, localEnabledTheme.manifest.name, 'Unexpected extension for @enabled query.');
|
||||
assert.equal(result.get(1).name, localRandom.manifest.name, 'Unexpected extension for @enabled query.');
|
||||
assert.equal(result.get(2).name, localEnabledLanguage.manifest.name, 'Unexpected extension for @enabled query.');
|
||||
});
|
||||
|
||||
const allBuiltinThemesCheck = testableView.show('@builtin:themes').then(result => {
|
||||
assert.equal(result.length, 1, 'Unexpected number of results for @builtin:themes query');
|
||||
assert.equal(result.get(0).name, builtInTheme.manifest.name, 'Unexpected extension for @builtin:themes query.');
|
||||
});
|
||||
|
||||
const allBuiltinBasicsCheck = testableView.show('@builtin:basics').then(result => {
|
||||
assert.equal(result.length, 1, 'Unexpected number of results for @builtin:basics query');
|
||||
assert.equal(result.get(0).name, builtInBasic.manifest.name, 'Unexpected extension for @builtin:basics query.');
|
||||
});
|
||||
|
||||
const allBuiltinCheck = testableView.show('@builtin').then(result => {
|
||||
assert.equal(result.length, 2, 'Unexpected number of results for @builtin query');
|
||||
assert.equal(result.get(0).name, builtInBasic.manifest.name, 'Unexpected extension for @builtin query.');
|
||||
assert.equal(result.get(1).name, builtInTheme.manifest.name, 'Unexpected extension for @builtin query.');
|
||||
});
|
||||
|
||||
const builtinCheck = testableView.show('@builtin my-theme').then(result => {
|
||||
assert.equal(result.length, 1, 'Unexpected number of results for @builtin query');
|
||||
assert.equal(result.get(0).name, builtInTheme.manifest.name, 'Unexpected extension for @builtin query.');
|
||||
});
|
||||
|
||||
return Promise.all([
|
||||
allInstalledCheck,
|
||||
installedCheck,
|
||||
allDisabledCheck,
|
||||
allEnabledCheck,
|
||||
allBuiltinThemesCheck,
|
||||
allBuiltinBasicsCheck,
|
||||
allBuiltinCheck,
|
||||
builtinCheck]);
|
||||
});
|
||||
|
||||
test('Test installed query with category', () => {
|
||||
const installedCategoryWithoutQuotesCheck = testableView.show('@installed category:themes').then(result => {
|
||||
assert.equal(result.length, 2, 'Unexpected number of results for @installed query with category');
|
||||
assert.equal(result.get(0).name, localDisabledTheme.manifest.name, 'Unexpected extension for @installed query with category.');
|
||||
assert.equal(result.get(1).name, localEnabledTheme.manifest.name, 'Unexpected extension for @installed query with category.');
|
||||
});
|
||||
|
||||
const installedCategoryWithQuotesCheck = testableView.show('@installed category:"themes"').then(result => {
|
||||
assert.equal(result.length, 2, 'Unexpected number of results for @installed query with quoted category');
|
||||
assert.equal(result.get(0).name, localDisabledTheme.manifest.name, 'Unexpected extension for @installed query with quoted category.');
|
||||
assert.equal(result.get(1).name, localEnabledTheme.manifest.name, 'Unexpected extension for @installed query with quoted category.');
|
||||
});
|
||||
|
||||
const installedCategoryWithSpaceCheck = testableView.show('@installed category:"programming languages"').then(result => {
|
||||
assert.equal(result.length, 2, 'Unexpected number of results for @installed query with quoted category including space');
|
||||
assert.equal(result.get(0).name, localDisabledLanguage.manifest.name, 'Unexpected extension for @installed query with quoted category inlcuding space.');
|
||||
assert.equal(result.get(1).name, localEnabledLanguage.manifest.name, 'Unexpected extension for @installed query with quoted category including space.');
|
||||
});
|
||||
|
||||
const installedMultipleCategoryCheck = testableView.show('@installed category:themes category:random').then(result => {
|
||||
assert.equal(result.length, 3, 'Unexpected number of results for @installed query with multiple category');
|
||||
assert.equal(result.get(0).name, localDisabledTheme.manifest.name, 'Unexpected extension for @installed query with multiple category.');
|
||||
assert.equal(result.get(1).name, localEnabledTheme.manifest.name, 'Unexpected extension for @installed query with multiple category.');
|
||||
assert.equal(result.get(2).name, localRandom.manifest.name, 'Unexpected extension for @installed query with multiple category.');
|
||||
});
|
||||
|
||||
const enabledCategoryWithoutQuotesCheck = testableView.show('@enabled category:themes').then(result => {
|
||||
assert.equal(result.length, 1, 'Unexpected number of results for @enabled query with category');
|
||||
assert.equal(result.get(0).name, localEnabledTheme.manifest.name, 'Unexpected extension for @enabled query with category.');
|
||||
});
|
||||
|
||||
const enabledCategoryWithQuotesCheck = testableView.show('@enabled category:"themes"').then(result => {
|
||||
assert.equal(result.length, 1, 'Unexpected number of results for @enabled query with quoted category');
|
||||
assert.equal(result.get(0).name, localEnabledTheme.manifest.name, 'Unexpected extension for @enabled query with quoted category.');
|
||||
});
|
||||
|
||||
const enabledCategoryWithSpaceCheck = testableView.show('@enabled category:"programming languages"').then(result => {
|
||||
assert.equal(result.length, 1, 'Unexpected number of results for @enabled query with quoted category inlcuding space');
|
||||
assert.equal(result.get(0).name, localEnabledLanguage.manifest.name, 'Unexpected extension for @enabled query with quoted category including space.');
|
||||
});
|
||||
|
||||
const disabledCategoryWithoutQuotesCheck = testableView.show('@disabled category:themes').then(result => {
|
||||
assert.equal(result.length, 1, 'Unexpected number of results for @disabled query with category');
|
||||
assert.equal(result.get(0).name, localDisabledTheme.manifest.name, 'Unexpected extension for @disabled query with category.');
|
||||
});
|
||||
|
||||
const disabledCategoryWithQuotesCheck = testableView.show('@disabled category:"themes"').then(result => {
|
||||
assert.equal(result.length, 1, 'Unexpected number of results for @disabled query with quoted category');
|
||||
assert.equal(result.get(0).name, localDisabledTheme.manifest.name, 'Unexpected extension for @disabled query with quoted category.');
|
||||
});
|
||||
|
||||
const disabledCategoryWithSpaceCheck = testableView.show('@disabled category:"programming languages"').then(result => {
|
||||
assert.equal(result.length, 1, 'Unexpected number of results for @disabled query with quoted category inlcuding space');
|
||||
assert.equal(result.get(0).name, localDisabledLanguage.manifest.name, 'Unexpected extension for @disabled query with quoted category including space.');
|
||||
});
|
||||
|
||||
return Promise.resolve([
|
||||
installedCategoryWithoutQuotesCheck,
|
||||
installedCategoryWithQuotesCheck,
|
||||
installedCategoryWithSpaceCheck,
|
||||
installedMultipleCategoryCheck,
|
||||
enabledCategoryWithoutQuotesCheck,
|
||||
enabledCategoryWithQuotesCheck,
|
||||
enabledCategoryWithSpaceCheck,
|
||||
disabledCategoryWithoutQuotesCheck,
|
||||
disabledCategoryWithQuotesCheck,
|
||||
disabledCategoryWithSpaceCheck
|
||||
]);
|
||||
});
|
||||
|
||||
test('Test @recommended:workspace query', () => {
|
||||
const workspaceRecommendedExtensions = [
|
||||
workspaceRecommendationA,
|
||||
workspaceRecommendationB
|
||||
];
|
||||
const target = <SinonStub>instantiationService.stubPromise(IExtensionGalleryService, 'query', aPage(...workspaceRecommendedExtensions));
|
||||
|
||||
return testableView.show('@recommended:workspace').then(result => {
|
||||
assert.ok(target.calledOnce);
|
||||
const options: IQueryOptions = target.args[0][0];
|
||||
assert.equal(options.names!.length, workspaceRecommendedExtensions.length);
|
||||
assert.equal(result.length, workspaceRecommendedExtensions.length);
|
||||
for (let i = 0; i < workspaceRecommendedExtensions.length; i++) {
|
||||
assert.equal(options.names![i], workspaceRecommendedExtensions[i].identifier.id);
|
||||
assert.equal(result.get(i).identifier.id, workspaceRecommendedExtensions[i].identifier.id);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
test('Test @recommended query', () => {
|
||||
const allRecommendedExtensions = [
|
||||
fileBasedRecommendationA,
|
||||
fileBasedRecommendationB,
|
||||
otherRecommendationA
|
||||
];
|
||||
const target = <SinonStub>instantiationService.stubPromise(IExtensionGalleryService, 'query', aPage(...allRecommendedExtensions));
|
||||
|
||||
return testableView.show('@recommended').then(result => {
|
||||
const options: IQueryOptions = target.args[0][0];
|
||||
|
||||
assert.ok(target.calledOnce);
|
||||
assert.equal(options.names!.length, allRecommendedExtensions.length);
|
||||
assert.equal(result.length, allRecommendedExtensions.length);
|
||||
for (let i = 0; i < allRecommendedExtensions.length; i++) {
|
||||
assert.equal(options.names![i], allRecommendedExtensions[i].identifier.id);
|
||||
assert.equal(result.get(i).identifier.id, allRecommendedExtensions[i].identifier.id);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
test('Test @recommended:all query', () => {
|
||||
const allRecommendedExtensions = [
|
||||
workspaceRecommendationA,
|
||||
workspaceRecommendationB,
|
||||
fileBasedRecommendationA,
|
||||
fileBasedRecommendationB,
|
||||
otherRecommendationA
|
||||
];
|
||||
const target = <SinonStub>instantiationService.stubPromise(IExtensionGalleryService, 'query', aPage(...allRecommendedExtensions));
|
||||
|
||||
return testableView.show('@recommended:all').then(result => {
|
||||
const options: IQueryOptions = target.args[0][0];
|
||||
|
||||
assert.ok(target.calledOnce);
|
||||
assert.equal(options.names!.length, allRecommendedExtensions.length);
|
||||
assert.equal(result.length, allRecommendedExtensions.length);
|
||||
for (let i = 0; i < allRecommendedExtensions.length; i++) {
|
||||
assert.equal(options.names![i], allRecommendedExtensions[i].identifier.id);
|
||||
assert.equal(result.get(i).identifier.id, allRecommendedExtensions[i].identifier.id);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
test('Test curated list experiment', () => {
|
||||
const curatedList = [
|
||||
workspaceRecommendationA,
|
||||
fileBasedRecommendationA
|
||||
];
|
||||
const experimentTarget = <SinonStub>instantiationService.stubPromise(IExperimentService, 'getCuratedExtensionsList', curatedList.map(e => e.identifier.id));
|
||||
const queryTarget = <SinonStub>instantiationService.stubPromise(IExtensionGalleryService, 'query', aPage(...curatedList));
|
||||
|
||||
return testableView.show('curated:mykey').then(result => {
|
||||
const curatedKey: string = experimentTarget.args[0][0];
|
||||
const options: IQueryOptions = queryTarget.args[0][0];
|
||||
|
||||
assert.ok(experimentTarget.calledOnce);
|
||||
assert.ok(queryTarget.calledOnce);
|
||||
assert.equal(options.names!.length, curatedList.length);
|
||||
assert.equal(result.length, curatedList.length);
|
||||
for (let i = 0; i < curatedList.length; i++) {
|
||||
assert.equal(options.names![i], curatedList[i].identifier.id);
|
||||
assert.equal(result.get(i).identifier.id, curatedList[i].identifier.id);
|
||||
}
|
||||
assert.equal(curatedKey, 'mykey');
|
||||
});
|
||||
});
|
||||
|
||||
test('Test search', () => {
|
||||
const searchText = 'search-me';
|
||||
const results = [
|
||||
fileBasedRecommendationA,
|
||||
workspaceRecommendationA,
|
||||
otherRecommendationA,
|
||||
workspaceRecommendationB
|
||||
];
|
||||
const queryTarget = <SinonStub>instantiationService.stubPromise(IExtensionGalleryService, 'query', aPage(...results));
|
||||
return testableView.show('search-me').then(result => {
|
||||
const options: IQueryOptions = queryTarget.args[0][0];
|
||||
|
||||
assert.ok(queryTarget.calledOnce);
|
||||
assert.equal(options.text, searchText);
|
||||
assert.equal(result.length, results.length);
|
||||
for (let i = 0; i < results.length; i++) {
|
||||
assert.equal(result.get(i).identifier.id, results[i].identifier.id);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
test('Test preferred search experiment', () => {
|
||||
const searchText = 'search-me';
|
||||
const actual = [
|
||||
fileBasedRecommendationA,
|
||||
workspaceRecommendationA,
|
||||
otherRecommendationA,
|
||||
workspaceRecommendationB
|
||||
];
|
||||
const expected = [
|
||||
workspaceRecommendationA,
|
||||
workspaceRecommendationB,
|
||||
fileBasedRecommendationA,
|
||||
otherRecommendationA
|
||||
];
|
||||
|
||||
const queryTarget = <SinonStub>instantiationService.stubPromise(IExtensionGalleryService, 'query', aPage(...actual));
|
||||
const experimentTarget = <SinonStub>instantiationService.stubPromise(IExperimentService, 'getExperimentsByType', [{
|
||||
id: 'someId',
|
||||
enabled: true,
|
||||
state: ExperimentState.Run,
|
||||
action: {
|
||||
type: ExperimentActionType.ExtensionSearchResults,
|
||||
properties: {
|
||||
searchText: 'search-me',
|
||||
preferredResults: [
|
||||
workspaceRecommendationA.identifier.id,
|
||||
'something-that-wasnt-in-first-page',
|
||||
workspaceRecommendationB.identifier.id
|
||||
]
|
||||
}
|
||||
}
|
||||
}]);
|
||||
|
||||
testableView.dispose();
|
||||
testableView = instantiationService.createInstance(ExtensionsListView, {});
|
||||
|
||||
return testableView.show('search-me').then(result => {
|
||||
const options: IQueryOptions = queryTarget.args[0][0];
|
||||
|
||||
assert.ok(experimentTarget.calledOnce);
|
||||
assert.ok(queryTarget.calledOnce);
|
||||
assert.equal(options.text, searchText);
|
||||
assert.equal(result.length, expected.length);
|
||||
for (let i = 0; i < expected.length; i++) {
|
||||
assert.equal(result.get(i).identifier.id, expected[i].identifier.id);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
test('Skip preferred search experiment when user defines sort order', () => {
|
||||
const searchText = 'search-me';
|
||||
const realResults = [
|
||||
fileBasedRecommendationA,
|
||||
workspaceRecommendationA,
|
||||
otherRecommendationA,
|
||||
workspaceRecommendationB
|
||||
];
|
||||
|
||||
const queryTarget = <SinonStub>instantiationService.stubPromise(IExtensionGalleryService, 'query', aPage(...realResults));
|
||||
|
||||
testableView.dispose();
|
||||
testableView = instantiationService.createInstance(ExtensionsListView, {});
|
||||
|
||||
return testableView.show('search-me @sort:installs').then(result => {
|
||||
const options: IQueryOptions = queryTarget.args[0][0];
|
||||
|
||||
assert.ok(queryTarget.calledOnce);
|
||||
assert.equal(options.text, searchText);
|
||||
assert.equal(result.length, realResults.length);
|
||||
for (let i = 0; i < realResults.length; i++) {
|
||||
assert.equal(result.get(i).identifier.id, realResults[i].identifier.id);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
function aLocalExtension(name: string = 'someext', manifest: any = {}, properties: any = {}): ILocalExtension {
|
||||
manifest = assign({ name, publisher: 'pub', version: '1.0.0' }, manifest);
|
||||
properties = assign({
|
||||
type: ExtensionType.User,
|
||||
location: URI.file(`pub.${name}`),
|
||||
identifier: { id: getGalleryExtensionId(manifest.publisher, manifest.name), uuid: undefined },
|
||||
metadata: { id: getGalleryExtensionId(manifest.publisher, manifest.name), publisherId: manifest.publisher, publisherDisplayName: 'somename' }
|
||||
}, properties);
|
||||
return <ILocalExtension>Object.create({ manifest, ...properties });
|
||||
}
|
||||
|
||||
function aGalleryExtension(name: string, properties: any = {}, galleryExtensionProperties: any = {}, assets: any = {}): IGalleryExtension {
|
||||
const galleryExtension = <IGalleryExtension>Object.create({});
|
||||
assign(galleryExtension, { name, publisher: 'pub', version: '1.0.0', properties: {}, assets: {} }, properties);
|
||||
assign(galleryExtension.properties, { dependencies: [] }, galleryExtensionProperties);
|
||||
assign(galleryExtension.assets, assets);
|
||||
galleryExtension.identifier = { id: getGalleryExtensionId(galleryExtension.publisher, galleryExtension.name), uuid: generateUuid() };
|
||||
return <IGalleryExtension>galleryExtension;
|
||||
}
|
||||
|
||||
function aPage<T>(...objects: T[]): IPager<T> {
|
||||
return { firstPage: objects, total: objects.length, pageSize: objects.length, getPage: () => null! };
|
||||
}
|
||||
});
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user