understand categories. fixes #23

This commit is contained in:
Joao Moreno 2015-11-03 17:43:25 -08:00
parent beda83957b
commit d6f2afbc88
4 changed files with 21 additions and 0 deletions

View file

@ -5,6 +5,7 @@
<DisplayName>${ displayName }</DisplayName>
<Description xml:space="preserve">${ description }</Description>
<Tags>${ tags }</Tags>
<Categories>${ categories }</Categories>
<GalleryFlags>Public</GalleryFlags>
<Properties>
<% if (links.repository) { %>

View file

@ -25,6 +25,7 @@ export interface Manifest {
displayName?: string;
description?: string;
keywords?: string[];
categories?: string[];
homepage?: string;
bugs?: string | { url?: string; email?: string };
license?: string;

View file

@ -93,6 +93,7 @@ class MainProcessor extends BaseProcessor {
publisher: manifest.publisher,
description: manifest.description || '',
tags: (manifest.keywords || []).concat('vscode').join(','),
categories: (manifest.categories || []).join(','),
links: {
repository: getUrl(manifest.repository),
bugs: getUrl(manifest.bugs),

View file

@ -298,6 +298,24 @@ describe('toVsixManifest', () => {
assert.ok(properties.some(p => p.Id === 'Microsoft.VisualStudio.Services.Links.Learn' && p.Value === 'https://github.com/Microsoft/vscode-spell-check'));
});
});
it('should understand categories', () => {
const manifest = {
name: 'test',
publisher: 'mocha',
version: '0.0.1',
engines: Object.create(null),
categories: ['hello', 'world']
};
return toVsixManifest(manifest, [])
.then(xml => parseXml(xml))
.then(result => {
const categories = result.PackageManifest.Metadata[0].Categories[0].split(',');
assert.ok(categories.some(c => c === 'hello'));
assert.ok(categories.some(c => c === 'world'));
});
});
});
describe('toContentTypes', () => {