@theia/plugin-utils 1.77.0-next.0 → 1.77.0-next.101

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (92) hide show
  1. package/lib/common/constants.js +12 -15
  2. package/lib/common/constants.js.map +1 -1
  3. package/lib/common/constants.spec.js +7 -9
  4. package/lib/common/constants.spec.js.map +1 -1
  5. package/lib/common/contribution-types.d.ts +3 -3
  6. package/lib/common/contribution-types.d.ts.map +1 -1
  7. package/lib/common/contribution-types.js +4 -7
  8. package/lib/common/contribution-types.js.map +1 -1
  9. package/lib/common/manifest-types.d.ts +1 -1
  10. package/lib/common/manifest-types.d.ts.map +1 -1
  11. package/lib/common/manifest-types.js +7 -11
  12. package/lib/common/manifest-types.js.map +1 -1
  13. package/lib/common/manifest-types.spec.js +7 -9
  14. package/lib/common/manifest-types.spec.js.map +1 -1
  15. package/lib/common/package-nls.js +6 -11
  16. package/lib/common/package-nls.js.map +1 -1
  17. package/lib/common/package-nls.spec.js +23 -24
  18. package/lib/common/package-nls.spec.js.map +1 -1
  19. package/lib/common/plugin-activation-events.d.ts +1 -1
  20. package/lib/common/plugin-activation-events.d.ts.map +1 -1
  21. package/lib/common/plugin-activation-events.js +14 -17
  22. package/lib/common/plugin-activation-events.js.map +1 -1
  23. package/lib/common/plugin-activation-events.spec.js +14 -16
  24. package/lib/common/plugin-activation-events.spec.js.map +1 -1
  25. package/lib/common/plugin-manifest.d.ts +1 -1
  26. package/lib/common/plugin-manifest.d.ts.map +1 -1
  27. package/lib/common/plugin-manifest.js +8 -12
  28. package/lib/common/plugin-manifest.js.map +1 -1
  29. package/lib/common/plugin-manifest.spec.js +21 -22
  30. package/lib/common/plugin-manifest.spec.js.map +1 -1
  31. package/lib/common/plugin-model.d.ts +1 -1
  32. package/lib/common/plugin-model.d.ts.map +1 -1
  33. package/lib/common/plugin-model.js +23 -37
  34. package/lib/common/plugin-model.js.map +1 -1
  35. package/lib/common/plugin-model.spec.js +66 -68
  36. package/lib/common/plugin-model.spec.js.map +1 -1
  37. package/lib/common/protocol-shims.js +3 -6
  38. package/lib/common/protocol-shims.js.map +1 -1
  39. package/lib/common/test-helpers.d.ts +2 -2
  40. package/lib/common/test-helpers.d.ts.map +1 -1
  41. package/lib/common/test-helpers.js +5 -9
  42. package/lib/common/test-helpers.js.map +1 -1
  43. package/lib/common/utils.js +6 -14
  44. package/lib/common/utils.js.map +1 -1
  45. package/lib/common/utils.spec.js +25 -27
  46. package/lib/common/utils.spec.js.map +1 -1
  47. package/lib/node/normalize-contributions.d.ts +3 -3
  48. package/lib/node/normalize-contributions.d.ts.map +1 -1
  49. package/lib/node/normalize-contributions.js +86 -126
  50. package/lib/node/normalize-contributions.js.map +1 -1
  51. package/lib/node/normalize-contributions.spec.js +158 -160
  52. package/lib/node/normalize-contributions.spec.js.map +1 -1
  53. package/lib/node/package-nls.d.ts +1 -1
  54. package/lib/node/package-nls.d.ts.map +1 -1
  55. package/lib/node/package-nls.js +9 -11
  56. package/lib/node/package-nls.js.map +1 -1
  57. package/lib/node/plugin-manifest.d.ts +2 -2
  58. package/lib/node/plugin-manifest.d.ts.map +1 -1
  59. package/lib/node/plugin-manifest.js +6 -8
  60. package/lib/node/plugin-manifest.js.map +1 -1
  61. package/lib/node/plugin-model.d.ts +1 -1
  62. package/lib/node/plugin-model.d.ts.map +1 -1
  63. package/lib/node/plugin-model.js +5 -8
  64. package/lib/node/plugin-model.js.map +1 -1
  65. package/lib/node/read-grammars.d.ts +2 -2
  66. package/lib/node/read-grammars.d.ts.map +1 -1
  67. package/lib/node/read-grammars.js +8 -11
  68. package/lib/node/read-grammars.js.map +1 -1
  69. package/lib/node/read-grammars.spec.js +25 -26
  70. package/lib/node/read-grammars.spec.js.map +1 -1
  71. package/package.json +10 -2
  72. package/src/common/constants.spec.ts +1 -1
  73. package/src/common/contribution-types.ts +3 -3
  74. package/src/common/manifest-types.spec.ts +1 -1
  75. package/src/common/manifest-types.ts +2 -2
  76. package/src/common/package-nls.spec.ts +4 -3
  77. package/src/common/package-nls.ts +1 -1
  78. package/src/common/plugin-activation-events.spec.ts +2 -2
  79. package/src/common/plugin-activation-events.ts +2 -2
  80. package/src/common/plugin-manifest.spec.ts +6 -5
  81. package/src/common/plugin-manifest.ts +3 -3
  82. package/src/common/plugin-model.spec.ts +4 -4
  83. package/src/common/plugin-model.ts +2 -2
  84. package/src/common/test-helpers.ts +3 -3
  85. package/src/common/utils.spec.ts +2 -2
  86. package/src/node/normalize-contributions.spec.ts +5 -5
  87. package/src/node/normalize-contributions.ts +5 -5
  88. package/src/node/package-nls.ts +4 -3
  89. package/src/node/plugin-manifest.ts +4 -3
  90. package/src/node/plugin-model.ts +1 -1
  91. package/src/node/read-grammars.spec.ts +3 -2
  92. package/src/node/read-grammars.ts +5 -4
@@ -1,4 +1,3 @@
1
- "use strict";
2
1
  // *****************************************************************************
3
2
  // Copyright (C) 2026 Maksim Kachurin and others.
4
3
  //
@@ -14,39 +13,38 @@
14
13
  //
15
14
  // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
16
15
  // *****************************************************************************
17
- Object.defineProperty(exports, "__esModule", { value: true });
18
- const chai_1 = require("chai");
19
- const contribution_types_1 = require("../common/contribution-types");
20
- const protocol_shims_1 = require("../common/protocol-shims");
21
- const normalize_contributions_1 = require("./normalize-contributions");
22
- const test_helpers_1 = require("../common/test-helpers");
16
+ import { expect } from 'chai';
17
+ import { CustomEditorPriority } from '../common/contribution-types.js';
18
+ import { PreferenceScope } from '../common/protocol-shims.js';
19
+ import { deriveDefaultForType, extractPluginViewsIds, getScope, normalizeContributions, readColors, readCommand, readConfiguration, readCustomEditors, readDebuggers, readIconThemes, readIcons, readKeybinding, readLanguages, readLocalization, readLocalizations, readMenus, readSnippets, readSubmenus, readTaskDefinition, readTerminals, readThemes, readViews, readViewsContainers, readViewContainer, readViewWelcome, readViewsWelcome, readWalkthroughs, toSchema, transformIconUrl } from './normalize-contributions.js';
20
+ import { createNormalizeCtx, manifest } from '../common/test-helpers.js';
23
21
  describe('normalize-contributions', () => {
24
22
  describe('deriveDefaultForType', () => {
25
23
  it('mirrors VS Code defaults for each json type', () => {
26
- (0, chai_1.expect)((0, normalize_contributions_1.deriveDefaultForType)('boolean')).to.equal(false);
27
- (0, chai_1.expect)((0, normalize_contributions_1.deriveDefaultForType)('integer')).to.equal(0);
28
- (0, chai_1.expect)((0, normalize_contributions_1.deriveDefaultForType)('number')).to.equal(0);
29
- (0, chai_1.expect)((0, normalize_contributions_1.deriveDefaultForType)('string')).to.equal('');
30
- (0, chai_1.expect)((0, normalize_contributions_1.deriveDefaultForType)('array')).to.deep.equal([]);
31
- (0, chai_1.expect)((0, normalize_contributions_1.deriveDefaultForType)('object')).to.deep.equal({});
24
+ expect(deriveDefaultForType('boolean')).to.equal(false);
25
+ expect(deriveDefaultForType('integer')).to.equal(0);
26
+ expect(deriveDefaultForType('number')).to.equal(0);
27
+ expect(deriveDefaultForType('string')).to.equal('');
28
+ expect(deriveDefaultForType('array')).to.deep.equal([]);
29
+ expect(deriveDefaultForType('object')).to.deep.equal({});
32
30
  // eslint-disable-next-line no-null/no-null
33
- (0, chai_1.expect)((0, normalize_contributions_1.deriveDefaultForType)(undefined)).to.equal(null);
31
+ expect(deriveDefaultForType(undefined)).to.equal(null);
34
32
  });
35
33
  it('uses the first type when an array is provided', () => {
36
- (0, chai_1.expect)((0, normalize_contributions_1.deriveDefaultForType)(['string', 'number'])).to.equal('');
34
+ expect(deriveDefaultForType(['string', 'number'])).to.equal('');
37
35
  });
38
36
  });
39
37
  describe('getScope', () => {
40
38
  it('maps monaco scopes to preference scope and overridable flag', () => {
41
- (0, chai_1.expect)((0, normalize_contributions_1.getScope)('machine-overridable')).to.deep.equal({ scope: protocol_shims_1.PreferenceScope.Folder, overridable: false });
42
- (0, chai_1.expect)((0, normalize_contributions_1.getScope)('language-overridable')).to.deep.equal({ scope: protocol_shims_1.PreferenceScope.Folder, overridable: true });
43
- (0, chai_1.expect)((0, normalize_contributions_1.getScope)('application')).to.deep.equal({ scope: protocol_shims_1.PreferenceScope.User, overridable: false });
44
- (0, chai_1.expect)((0, normalize_contributions_1.getScope)(undefined)).to.deep.equal({ scope: undefined, overridable: false });
39
+ expect(getScope('machine-overridable')).to.deep.equal({ scope: PreferenceScope.Folder, overridable: false });
40
+ expect(getScope('language-overridable')).to.deep.equal({ scope: PreferenceScope.Folder, overridable: true });
41
+ expect(getScope('application')).to.deep.equal({ scope: PreferenceScope.User, overridable: false });
42
+ expect(getScope(undefined)).to.deep.equal({ scope: undefined, overridable: false });
45
43
  });
46
44
  });
47
45
  describe('readConfiguration', () => {
48
46
  it('derives defaults and property scopes', () => {
49
- const schema = (0, normalize_contributions_1.readConfiguration)({
47
+ const schema = readConfiguration({
50
48
  title: 'Sample',
51
49
  scope: 'application',
52
50
  properties: {
@@ -54,20 +52,20 @@ describe('normalize-contributions', () => {
54
52
  'sample.path': { type: 'string', default: '/tmp' }
55
53
  }
56
54
  }, '/tmp/plugin');
57
- (0, chai_1.expect)(schema?.scope).to.equal(protocol_shims_1.PreferenceScope.User);
58
- (0, chai_1.expect)(schema?.properties['sample.enabled'].default).to.equal(false);
59
- (0, chai_1.expect)(schema?.properties['sample.enabled'].overridable).to.equal(true);
60
- (0, chai_1.expect)(schema?.properties['sample.path'].default).to.equal('/tmp');
55
+ expect(schema?.scope).to.equal(PreferenceScope.User);
56
+ expect(schema?.properties['sample.enabled'].default).to.equal(false);
57
+ expect(schema?.properties['sample.enabled'].overridable).to.equal(true);
58
+ expect(schema?.properties['sample.path'].default).to.equal('/tmp');
61
59
  });
62
60
  });
63
61
  describe('transformIconUrl and readCommand', () => {
64
62
  it('resolves file icons and codicons', () => {
65
- const ctx = (0, test_helpers_1.createNormalizeCtx)();
66
- (0, chai_1.expect)((0, normalize_contributions_1.transformIconUrl)(ctx, ctx.plugin, './media/icon.png')).to.deep.equal({
63
+ const ctx = createNormalizeCtx();
64
+ expect(transformIconUrl(ctx, ctx.plugin, './media/icon.png')).to.deep.equal({
67
65
  iconUrl: 'hostedPlugin/acme_test_ext/media/icon.png'
68
66
  });
69
- (0, chai_1.expect)((0, normalize_contributions_1.transformIconUrl)(ctx, ctx.plugin, '$(zap)')).to.deep.equal({ themeIcon: '$(zap)' });
70
- (0, chai_1.expect)((0, normalize_contributions_1.transformIconUrl)(ctx, ctx.plugin, {
67
+ expect(transformIconUrl(ctx, ctx.plugin, '$(zap)')).to.deep.equal({ themeIcon: '$(zap)' });
68
+ expect(transformIconUrl(ctx, ctx.plugin, {
71
69
  light: './light.png',
72
70
  dark: './dark.png'
73
71
  })).to.deep.equal({
@@ -76,13 +74,13 @@ describe('normalize-contributions', () => {
76
74
  dark: 'hostedPlugin/acme_test_ext/dark.png'
77
75
  }
78
76
  });
79
- const command = (0, normalize_contributions_1.readCommand)(ctx, {
77
+ const command = readCommand(ctx, {
80
78
  command: 'sample.run',
81
79
  title: 'Run',
82
80
  original: 'Original',
83
81
  icon: '$(play)'
84
82
  }, ctx.plugin);
85
- (0, chai_1.expect)(command).to.include({
83
+ expect(command).to.include({
86
84
  command: 'sample.run',
87
85
  title: 'Run',
88
86
  originalTitle: 'Original',
@@ -90,14 +88,14 @@ describe('normalize-contributions', () => {
90
88
  });
91
89
  });
92
90
  it('honors ctx.transformIconUrl from readCommand / readSubmenu', () => {
93
- const ctx = (0, test_helpers_1.createNormalizeCtx)();
91
+ const ctx = createNormalizeCtx();
94
92
  ctx.transformIconUrl = () => ({ themeIcon: '$(custom)' });
95
- (0, chai_1.expect)((0, normalize_contributions_1.readCommand)(ctx, {
93
+ expect(readCommand(ctx, {
96
94
  command: 'sample.run',
97
95
  title: 'Run',
98
96
  icon: '$(play)'
99
97
  }, ctx.plugin).themeIcon).to.equal('$(custom)');
100
- (0, chai_1.expect)((0, normalize_contributions_1.readSubmenus)(ctx, [{
98
+ expect(readSubmenus(ctx, [{
101
99
  id: 'sample.submenu',
102
100
  label: 'Sample',
103
101
  icon: './icon.png'
@@ -106,7 +104,7 @@ describe('normalize-contributions', () => {
106
104
  });
107
105
  describe('readKeybinding and menus', () => {
108
106
  it('copies keybinding fields', () => {
109
- (0, chai_1.expect)((0, normalize_contributions_1.readKeybinding)({
107
+ expect(readKeybinding({
110
108
  key: 'ctrl+shift+p',
111
109
  command: 'sample.run',
112
110
  when: 'editorFocus',
@@ -122,7 +120,7 @@ describe('normalize-contributions', () => {
122
120
  });
123
121
  });
124
122
  it('copies menu fields', () => {
125
- (0, chai_1.expect)((0, normalize_contributions_1.readMenus)([{
123
+ expect(readMenus([{
126
124
  command: 'sample.run',
127
125
  group: 'navigation',
128
126
  when: 'true'
@@ -137,53 +135,53 @@ describe('normalize-contributions', () => {
137
135
  });
138
136
  describe('views', () => {
139
137
  it('extracts view ids across locations', () => {
140
- (0, chai_1.expect)((0, normalize_contributions_1.extractPluginViewsIds)({
138
+ expect(extractPluginViewsIds({
141
139
  explorer: [{ id: 'a', name: 'A' }],
142
140
  panel: [{ id: 'b', name: 'B' }]
143
141
  })).to.deep.equal(['a', 'b']);
144
142
  });
145
143
  it('normalizes view containers, views, and welcome content order', () => {
146
- const ctx = (0, test_helpers_1.createNormalizeCtx)();
147
- const containers = (0, normalize_contributions_1.readViewsContainers)(ctx, [{
144
+ const ctx = createNormalizeCtx();
145
+ const containers = readViewsContainers(ctx, [{
148
146
  id: 'sample.container',
149
147
  title: 'Sample',
150
148
  icon: '$(folder)'
151
149
  }], ctx.plugin);
152
- (0, chai_1.expect)(containers[0]).to.include({
150
+ expect(containers[0]).to.include({
153
151
  id: 'sample.container',
154
152
  themeIcon: '$(folder)'
155
153
  });
156
- (0, chai_1.expect)(containers[0].iconUrl).to.equal('hostedPlugin/acme_test_ext/%24(folder)');
157
- const views = (0, normalize_contributions_1.readViews)([{ id: 'sample.view', name: 'Sample View' }]);
158
- (0, chai_1.expect)(views).to.deep.equal([{
154
+ expect(containers[0].iconUrl).to.equal('hostedPlugin/acme_test_ext/%24(folder)');
155
+ const views = readViews([{ id: 'sample.view', name: 'Sample View' }]);
156
+ expect(views).to.deep.equal([{
159
157
  id: 'sample.view',
160
158
  name: 'Sample View',
161
159
  when: undefined,
162
160
  type: undefined
163
161
  }]);
164
- const welcome = (0, normalize_contributions_1.readViewsWelcome)([{
162
+ const welcome = readViewsWelcome([{
165
163
  view: 'sample.view',
166
164
  contents: 'Welcome'
167
165
  }], { explorer: [{ id: 'sample.view', name: 'Sample View' }] });
168
- (0, chai_1.expect)(welcome[0].order).to.equal(0);
169
- (0, chai_1.expect)((0, normalize_contributions_1.readViewWelcome)({
166
+ expect(welcome[0].order).to.equal(0);
167
+ expect(readViewWelcome({
170
168
  view: 'missing.view',
171
169
  contents: 'Missing'
172
170
  }, ['sample.view']).order).to.equal(1);
173
171
  });
174
172
  it('skips view containers without a string icon and reports an error', () => {
175
173
  const errors = [];
176
- const ctx = (0, test_helpers_1.createNormalizeCtx)({}, {
174
+ const ctx = createNormalizeCtx({}, {
177
175
  onError: (_kind, message) => {
178
176
  errors.push(message);
179
177
  }
180
178
  });
181
- (0, chai_1.expect)((0, normalize_contributions_1.readViewContainer)(ctx, {
179
+ expect(readViewContainer(ctx, {
182
180
  id: 'sample.container',
183
181
  title: 'Sample'
184
182
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
185
183
  }, ctx.plugin)).to.equal(undefined);
186
- (0, chai_1.expect)((0, normalize_contributions_1.readViewsContainers)(ctx, [{
184
+ expect(readViewsContainers(ctx, [{
187
185
  id: 'valid.container',
188
186
  title: 'Valid',
189
187
  icon: '$(folder)'
@@ -192,23 +190,23 @@ describe('normalize-contributions', () => {
192
190
  title: 'Invalid'
193
191
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
194
192
  }], ctx.plugin)).to.have.lengthOf(1);
195
- (0, chai_1.expect)(errors.length).to.be.greaterThan(0);
193
+ expect(errors.length).to.be.greaterThan(0);
196
194
  });
197
195
  });
198
196
  describe('custom editors and debuggers', () => {
199
197
  it('normalizes custom editors with default priority', () => {
200
- (0, chai_1.expect)((0, normalize_contributions_1.readCustomEditors)([{
198
+ expect(readCustomEditors([{
201
199
  viewType: 'sample.editor',
202
200
  displayName: 'Editor'
203
201
  }])).to.deep.equal([{
204
202
  viewType: 'sample.editor',
205
203
  displayName: 'Editor',
206
204
  selector: [],
207
- priority: contribution_types_1.CustomEditorPriority.default
205
+ priority: CustomEditorPriority.default
208
206
  }]);
209
207
  });
210
208
  it('copies debugger contributions', () => {
211
- (0, chai_1.expect)((0, normalize_contributions_1.readDebuggers)([{
209
+ expect(readDebuggers([{
212
210
  type: 'node',
213
211
  label: 'Node Debug',
214
212
  program: './out/debug.js',
@@ -237,8 +235,8 @@ describe('normalize-contributions', () => {
237
235
  });
238
236
  describe('themes, snippets, icon themes, and colors', () => {
239
237
  it('resolves theme and snippet uris', () => {
240
- const ctx = (0, test_helpers_1.createNormalizeCtx)(undefined, undefined);
241
- const plugin = (0, test_helpers_1.manifest)({
238
+ const ctx = createNormalizeCtx(undefined, undefined);
239
+ const plugin = manifest({
242
240
  name: 'themes',
243
241
  contributes: {
244
242
  themes: [{ id: 'dark', label: 'Dark', path: './themes/dark.json' }],
@@ -247,19 +245,19 @@ describe('normalize-contributions', () => {
247
245
  }
248
246
  });
249
247
  ctx.plugin = plugin;
250
- (0, chai_1.expect)((0, normalize_contributions_1.readThemes)(ctx, plugin)).to.deep.equal([{
248
+ expect(readThemes(ctx, plugin)).to.deep.equal([{
251
249
  id: 'dark',
252
250
  label: 'Dark',
253
251
  uri: 'hostedPlugin/acme_themes/themes/dark.json',
254
252
  description: undefined,
255
253
  uiTheme: undefined
256
254
  }]);
257
- (0, chai_1.expect)((0, normalize_contributions_1.readSnippets)(ctx, plugin)).to.deep.equal([{
255
+ expect(readSnippets(ctx, plugin)).to.deep.equal([{
258
256
  language: 'typescript',
259
257
  source: 'Test Extension',
260
258
  uri: 'hostedPlugin/acme_themes/snippets/ts.json'
261
259
  }]);
262
- (0, chai_1.expect)((0, normalize_contributions_1.readIconThemes)(ctx, plugin)).to.deep.equal([{
260
+ expect(readIconThemes(ctx, plugin)).to.deep.equal([{
263
261
  id: 'set',
264
262
  label: 'Set',
265
263
  uri: 'hostedPlugin/acme_themes/icons/theme.json',
@@ -270,8 +268,8 @@ describe('normalize-contributions', () => {
270
268
  // A `uiTheme` that does not survive normalization falls back to `vs-dark` in the frontend, which
271
269
  // files the theme under the dark ones and resolves its colors through the dark path.
272
270
  it('keeps every ui theme, including hc-light', () => {
273
- const ctx = (0, test_helpers_1.createNormalizeCtx)(undefined, undefined);
274
- const plugin = (0, test_helpers_1.manifest)({
271
+ const ctx = createNormalizeCtx(undefined, undefined);
272
+ const plugin = manifest({
275
273
  name: 'themes',
276
274
  contributes: {
277
275
  themes: [
@@ -285,17 +283,17 @@ describe('normalize-contributions', () => {
285
283
  }
286
284
  });
287
285
  ctx.plugin = plugin;
288
- (0, chai_1.expect)((0, normalize_contributions_1.readThemes)(ctx, plugin)?.map(theme => theme.uiTheme))
286
+ expect(readThemes(ctx, plugin)?.map(theme => theme.uiTheme))
289
287
  .to.deep.equal(['vs', 'vs-dark', 'hc-black', 'hc-light', undefined]);
290
288
  });
291
289
  it('validates color contributions and reports invalid ids', () => {
292
290
  const warnings = [];
293
- const ctx = (0, test_helpers_1.createNormalizeCtx)({ name: 'colors' }, {
291
+ const ctx = createNormalizeCtx({ name: 'colors' }, {
294
292
  onWarn: message => {
295
293
  warnings.push(message);
296
294
  }
297
295
  });
298
- const plugin = (0, test_helpers_1.manifest)({
296
+ const plugin = manifest({
299
297
  name: 'colors',
300
298
  contributes: {
301
299
  colors: [
@@ -309,19 +307,19 @@ describe('normalize-contributions', () => {
309
307
  }
310
308
  });
311
309
  ctx.plugin = plugin;
312
- const colors = (0, normalize_contributions_1.readColors)(ctx, plugin);
313
- (0, chai_1.expect)(colors).to.have.lengthOf(1);
314
- (0, chai_1.expect)(colors[0].defaults).to.deep.equal({ light: '#fff', dark: '#000', hc: '#111' });
315
- (0, chai_1.expect)(warnings.some(message => message.includes('word[.word]*'))).to.equal(true);
310
+ const colors = readColors(ctx, plugin);
311
+ expect(colors).to.have.lengthOf(1);
312
+ expect(colors[0].defaults).to.deep.equal({ light: '#fff', dark: '#000', hc: '#111' });
313
+ expect(warnings.some(message => message.includes('word[.word]*'))).to.equal(true);
316
314
  });
317
315
  it('rejects color contributions with empty descriptions', () => {
318
316
  const warnings = [];
319
- const ctx = (0, test_helpers_1.createNormalizeCtx)({ name: 'colors' }, {
317
+ const ctx = createNormalizeCtx({ name: 'colors' }, {
320
318
  onWarn: message => {
321
319
  warnings.push(message);
322
320
  }
323
321
  });
324
- const plugin = (0, test_helpers_1.manifest)({
322
+ const plugin = manifest({
325
323
  name: 'colors',
326
324
  contributes: {
327
325
  colors: [{
@@ -332,14 +330,14 @@ describe('normalize-contributions', () => {
332
330
  }
333
331
  });
334
332
  ctx.plugin = plugin;
335
- (0, chai_1.expect)((0, normalize_contributions_1.readColors)(ctx, plugin)).to.deep.equal([]);
336
- (0, chai_1.expect)(warnings.some(message => message.includes('description'))).to.equal(true);
333
+ expect(readColors(ctx, plugin)).to.deep.equal([]);
334
+ expect(warnings.some(message => message.includes('description'))).to.equal(true);
337
335
  });
338
336
  });
339
337
  describe('icons', () => {
340
338
  it('accepts icon references and font-based defaults', () => {
341
- const ctx = (0, test_helpers_1.createNormalizeCtx)({ name: 'icons', publisher: 'acme' });
342
- const plugin = (0, test_helpers_1.manifest)({
339
+ const ctx = createNormalizeCtx({ name: 'icons', publisher: 'acme' });
340
+ const plugin = manifest({
343
341
  name: 'icons',
344
342
  publisher: 'acme',
345
343
  contributes: {
@@ -359,8 +357,8 @@ describe('normalize-contributions', () => {
359
357
  }
360
358
  });
361
359
  ctx.plugin = plugin;
362
- const icons = (0, normalize_contributions_1.readIcons)(ctx, plugin);
363
- (0, chai_1.expect)(icons).to.deep.equal([
360
+ const icons = readIcons(ctx, plugin);
361
+ expect(icons).to.deep.equal([
364
362
  {
365
363
  id: 'sample-icon',
366
364
  extensionId: 'acme.icons',
@@ -381,7 +379,7 @@ describe('normalize-contributions', () => {
381
379
  });
382
380
  describe('terminals, localizations, submenus, and tasks', () => {
383
381
  it('reads terminal profiles with required fields only', () => {
384
- const plugin = (0, test_helpers_1.manifest)({
382
+ const plugin = manifest({
385
383
  name: 'terminal',
386
384
  contributes: {
387
385
  terminal: {
@@ -394,11 +392,11 @@ describe('normalize-contributions', () => {
394
392
  }
395
393
  }
396
394
  });
397
- (0, chai_1.expect)((0, normalize_contributions_1.readTerminals)(plugin)).to.deep.equal([{ id: 'bash', title: 'Bash' }]);
395
+ expect(readTerminals(plugin)).to.deep.equal([{ id: 'bash', title: 'Bash' }]);
398
396
  });
399
397
  it('drops empty theme/snippet paths (avoids resolving to the plugin root)', () => {
400
- const ctx = (0, test_helpers_1.createNormalizeCtx)(undefined, undefined);
401
- const plugin = (0, test_helpers_1.manifest)({
398
+ const ctx = createNormalizeCtx(undefined, undefined);
399
+ const plugin = manifest({
402
400
  name: 'empty-paths',
403
401
  contributes: {
404
402
  themes: [{ id: 'bad', path: '' }],
@@ -407,12 +405,12 @@ describe('normalize-contributions', () => {
407
405
  }
408
406
  });
409
407
  ctx.plugin = plugin;
410
- (0, chai_1.expect)((0, normalize_contributions_1.readThemes)(ctx, plugin)).to.deep.equal([]);
411
- (0, chai_1.expect)((0, normalize_contributions_1.readSnippets)(ctx, plugin)).to.deep.equal([]);
412
- (0, chai_1.expect)((0, normalize_contributions_1.readIconThemes)(ctx, plugin)).to.deep.equal([]);
408
+ expect(readThemes(ctx, plugin)).to.deep.equal([]);
409
+ expect(readSnippets(ctx, plugin)).to.deep.equal([]);
410
+ expect(readIconThemes(ctx, plugin)).to.deep.equal([]);
413
411
  });
414
412
  it('reads localization bundles', () => {
415
- const plugin = (0, test_helpers_1.manifest)({
413
+ const plugin = manifest({
416
414
  name: 'l10n',
417
415
  packagePath: '/tmp/plugin',
418
416
  contributes: {
@@ -423,7 +421,7 @@ describe('normalize-contributions', () => {
423
421
  }]
424
422
  }
425
423
  });
426
- (0, chai_1.expect)((0, normalize_contributions_1.readLocalizations)(plugin)).to.deep.equal([{
424
+ expect(readLocalizations(plugin)).to.deep.equal([{
427
425
  languageId: 'de',
428
426
  languageName: 'German',
429
427
  localizedLanguageName: undefined,
@@ -432,7 +430,7 @@ describe('normalize-contributions', () => {
432
430
  }]);
433
431
  });
434
432
  it('honors readLocalization / readTranslation ctx hooks', () => {
435
- const plugin = (0, test_helpers_1.manifest)({
433
+ const plugin = manifest({
436
434
  name: 'l10n',
437
435
  packagePath: '/tmp/plugin',
438
436
  contributes: {
@@ -442,13 +440,13 @@ describe('normalize-contributions', () => {
442
440
  }]
443
441
  }
444
442
  });
445
- const ctx = (0, test_helpers_1.createNormalizeCtx)({ name: 'l10n', packagePath: '/tmp/plugin' });
443
+ const ctx = createNormalizeCtx({ name: 'l10n', packagePath: '/tmp/plugin' });
446
444
  ctx.readTranslation = (entry, pluginPath) => ({
447
445
  id: entry.id,
448
446
  path: `${pluginPath}/${entry.path}`
449
447
  });
450
- ctx.readLocalization = (entry, pluginPath) => (0, normalize_contributions_1.readLocalization)(entry, pluginPath, ctx);
451
- (0, chai_1.expect)((0, normalize_contributions_1.readLocalizations)(plugin, ctx)).to.deep.equal([{
448
+ ctx.readLocalization = (entry, pluginPath) => readLocalization(entry, pluginPath, ctx);
449
+ expect(readLocalizations(plugin, ctx)).to.deep.equal([{
452
450
  languageId: 'de',
453
451
  languageName: undefined,
454
452
  localizedLanguageName: undefined,
@@ -457,8 +455,8 @@ describe('normalize-contributions', () => {
457
455
  }]);
458
456
  });
459
457
  it('reads submenu icons via transformIconUrl', () => {
460
- const ctx = (0, test_helpers_1.createNormalizeCtx)();
461
- (0, chai_1.expect)((0, normalize_contributions_1.readSubmenus)(ctx, [{
458
+ const ctx = createNormalizeCtx();
459
+ expect(readSubmenus(ctx, [{
462
460
  id: 'sample.submenu',
463
461
  label: 'Sample',
464
462
  icon: '$(gear)'
@@ -469,17 +467,17 @@ describe('normalize-contributions', () => {
469
467
  }]);
470
468
  });
471
469
  it('builds task definition schema with required type property', () => {
472
- const definition = (0, normalize_contributions_1.readTaskDefinition)('sample.tasks', {
470
+ const definition = readTaskDefinition('sample.tasks', {
473
471
  type: 'npm',
474
472
  required: ['script'],
475
473
  properties: {
476
474
  script: { type: 'string' }
477
475
  }
478
476
  });
479
- (0, chai_1.expect)(definition.taskType).to.equal('npm');
480
- (0, chai_1.expect)(definition.source).to.equal('sample.tasks');
481
- (0, chai_1.expect)(definition.properties.all).to.deep.equal(['script']);
482
- (0, chai_1.expect)((0, normalize_contributions_1.toSchema)({
477
+ expect(definition.taskType).to.equal('npm');
478
+ expect(definition.source).to.equal('sample.tasks');
479
+ expect(definition.properties.all).to.deep.equal(['script']);
480
+ expect(toSchema({
483
481
  type: 'npm',
484
482
  required: [],
485
483
  properties: { script: { type: 'string' } }
@@ -487,42 +485,42 @@ describe('normalize-contributions', () => {
487
485
  });
488
486
  it('honors ctx.toSchema from readTaskDefinition', () => {
489
487
  const customSchema = { type: 'object', properties: { custom: { type: 'boolean' } } };
490
- const definition = (0, normalize_contributions_1.readTaskDefinition)('sample.tasks', {
488
+ const definition = readTaskDefinition('sample.tasks', {
491
489
  type: 'npm',
492
490
  required: [],
493
491
  properties: {}
494
492
  }, {
495
493
  toSchema: () => customSchema
496
494
  });
497
- (0, chai_1.expect)(definition.properties.schema).to.equal(customSchema);
495
+ expect(definition.properties.schema).to.equal(customSchema);
498
496
  });
499
497
  });
500
498
  describe('readLanguage', () => {
501
499
  it('loads language configuration from a relative json file', async () => {
502
- const ctx = (0, test_helpers_1.createNormalizeCtx)({ name: 'lang', packagePath: '/tmp/plugin' }, {
500
+ const ctx = createNormalizeCtx({ name: 'lang', packagePath: '/tmp/plugin' }, {
503
501
  readJsonFile: async () => ({
504
502
  autoClosingPairs: [['{', '}'], { open: '[', close: ']', notIn: ['string'] }],
505
503
  surroundingPairs: [['(', ')']]
506
504
  })
507
505
  });
508
- const languages = await (0, normalize_contributions_1.readLanguages)(ctx, [{
506
+ const languages = await readLanguages(ctx, [{
509
507
  id: 'sample',
510
508
  configuration: './language-configuration.json'
511
509
  }], ctx.plugin);
512
- (0, chai_1.expect)(languages[0].configuration?.autoClosingPairs).to.deep.equal([
510
+ expect(languages[0].configuration?.autoClosingPairs).to.deep.equal([
513
511
  { open: '{', close: '}' },
514
512
  { open: '[', close: ']', notIn: ['string'] }
515
513
  ]);
516
- (0, chai_1.expect)(languages[0].configuration?.surroundingPairs).to.deep.equal([{ open: '(', close: ')' }]);
514
+ expect(languages[0].configuration?.surroundingPairs).to.deep.equal([{ open: '(', close: ')' }]);
517
515
  });
518
516
  });
519
517
  describe('normalizeContributions', () => {
520
518
  it('leaves output empty when the manifest has no contribution kinds', async () => {
521
- const contributions = await (0, normalize_contributions_1.normalizeContributions)((0, test_helpers_1.createNormalizeCtx)({ name: 'empty' }), {});
522
- (0, chai_1.expect)(Object.keys(contributions)).to.deep.equal([]);
519
+ const contributions = await normalizeContributions(createNormalizeCtx({ name: 'empty' }), {});
520
+ expect(Object.keys(contributions)).to.deep.equal([]);
523
521
  });
524
522
  it('normalizes supported contribution kinds via injectable readers', async () => {
525
- const ctx = (0, test_helpers_1.createNormalizeCtx)({
523
+ const ctx = createNormalizeCtx({
526
524
  name: 'full',
527
525
  contributes: {
528
526
  commands: [{ command: 'sample.run', title: 'Run' }],
@@ -530,10 +528,10 @@ describe('normalize-contributions', () => {
530
528
  configuration: { title: 'Sample', properties: { enabled: { type: 'boolean' } } }
531
529
  }
532
530
  });
533
- const contributions = await (0, normalize_contributions_1.normalizeContributions)(ctx, {});
534
- (0, chai_1.expect)(contributions).to.have.property('commands').with.lengthOf(1);
535
- (0, chai_1.expect)(contributions).to.have.property('keybindings').with.lengthOf(1);
536
- (0, chai_1.expect)(contributions).to.have.property('configuration').with.lengthOf(1);
531
+ const contributions = await normalizeContributions(ctx, {});
532
+ expect(contributions).to.have.property('commands').with.lengthOf(1);
533
+ expect(contributions).to.have.property('keybindings').with.lengthOf(1);
534
+ expect(contributions).to.have.property('configuration').with.lengthOf(1);
537
535
  });
538
536
  it('runs the orchestrator for shell layout, passthrough, and async contribution kinds', async () => {
539
537
  const readGrammars = async () => [{
@@ -543,7 +541,7 @@ describe('normalize-contributions', () => {
543
541
  grammar: { scopeName: 'source.sample' },
544
542
  grammarLocation: './grammar.json'
545
543
  }];
546
- const ctx = (0, test_helpers_1.createNormalizeCtx)({
544
+ const ctx = createNormalizeCtx({
547
545
  name: 'orchestrator',
548
546
  displayName: 'Orchestrator Extension',
549
547
  contributes: {
@@ -604,24 +602,24 @@ describe('normalize-contributions', () => {
604
602
  grammars: [{ language: 'sample-lang', scopeName: 'source.sample', path: './grammar.json' }]
605
603
  }
606
604
  }, { readGrammars });
607
- const contributions = await (0, normalize_contributions_1.normalizeContributions)(ctx, {});
608
- (0, chai_1.expect)(contributions.configurationDefaults).to.deep.equal({ 'sample.enabled': true });
605
+ const contributions = await normalizeContributions(ctx, {});
606
+ expect(contributions.configurationDefaults).to.deep.equal({ 'sample.enabled': true });
609
607
  const configuration = contributions.configuration;
610
- (0, chai_1.expect)(configuration).to.have.lengthOf(2);
611
- (0, chai_1.expect)(configuration[0].properties['sample.enabled'].owner).to.equal('Orchestrator Extension');
612
- (0, chai_1.expect)(configuration[0].properties['sample.enabled'].group).to.equal('General');
613
- (0, chai_1.expect)(contributions.submenus).to.deep.equal([{
608
+ expect(configuration).to.have.lengthOf(2);
609
+ expect(configuration[0].properties['sample.enabled'].owner).to.equal('Orchestrator Extension');
610
+ expect(configuration[0].properties['sample.enabled'].group).to.equal('General');
611
+ expect(contributions.submenus).to.deep.equal([{
614
612
  icon: '$(gear)',
615
613
  id: 'sample.submenu',
616
614
  label: 'Sample'
617
615
  }]);
618
- (0, chai_1.expect)(contributions.customEditors).to.deep.equal([{
616
+ expect(contributions.customEditors).to.deep.equal([{
619
617
  viewType: 'sample.editor',
620
618
  displayName: 'Editor',
621
619
  selector: [],
622
- priority: contribution_types_1.CustomEditorPriority.default
620
+ priority: CustomEditorPriority.default
623
621
  }]);
624
- (0, chai_1.expect)(contributions.viewsContainers).to.deep.equal({
622
+ expect(contributions.viewsContainers).to.deep.equal({
625
623
  left: [{
626
624
  id: 'sample.container',
627
625
  title: 'Sample',
@@ -637,20 +635,20 @@ describe('normalize-contributions', () => {
637
635
  when: undefined
638
636
  }]
639
637
  });
640
- (0, chai_1.expect)(contributions.views).to.deep.equal({
638
+ expect(contributions.views).to.deep.equal({
641
639
  explorer: [{ id: 'sample.view', name: 'Sample View', when: undefined, type: undefined }]
642
640
  });
643
- (0, chai_1.expect)(contributions.viewsWelcome).to.deep.equal([{
641
+ expect(contributions.viewsWelcome).to.deep.equal([{
644
642
  view: 'sample.view',
645
643
  content: 'Welcome',
646
644
  when: undefined,
647
645
  enablement: undefined,
648
646
  order: 0
649
647
  }]);
650
- (0, chai_1.expect)(contributions.menus).to.deep.equal({
648
+ expect(contributions.menus).to.deep.equal({
651
649
  'editor/title': [{ command: 'sample.run', group: 'navigation', submenu: undefined, alt: undefined, when: undefined }]
652
650
  });
653
- (0, chai_1.expect)(contributions.debuggers).to.deep.equal([{
651
+ expect(contributions.debuggers).to.deep.equal([{
654
652
  type: 'node',
655
653
  label: 'Node Debug',
656
654
  program: './debug.js',
@@ -669,7 +667,7 @@ describe('normalize-contributions', () => {
669
667
  runtimeArgs: undefined,
670
668
  configurationAttributes: undefined
671
669
  }]);
672
- (0, chai_1.expect)(contributions.taskDefinitions).to.deep.equal([{
670
+ expect(contributions.taskDefinitions).to.deep.equal([{
673
671
  taskType: 'npm',
674
672
  source: 'orchestrator',
675
673
  properties: {
@@ -685,52 +683,52 @@ describe('normalize-contributions', () => {
685
683
  }
686
684
  }
687
685
  }]);
688
- (0, chai_1.expect)(contributions.problemMatchers).to.deep.equal([{ name: 'sample-matcher' }]);
689
- (0, chai_1.expect)(contributions.problemPatterns).to.deep.equal([{ regexp: 'sample' }]);
690
- (0, chai_1.expect)(contributions.resourceLabelFormatters).to.deep.equal([{ scheme: 'file' }]);
691
- (0, chai_1.expect)(contributions.authentication).to.deep.equal([{ id: 'github', label: 'GitHub' }]);
692
- (0, chai_1.expect)(contributions.notebooks).to.deep.equal([{ type: 'sample-notebook', displayName: 'Notebook' }]);
693
- (0, chai_1.expect)(contributions.notebookRenderer).to.deep.equal([{ id: 'sample-renderer', displayName: 'Renderer' }]);
694
- (0, chai_1.expect)(contributions.notebookPreload).to.deep.equal([{ type: 'sample-preload' }]);
695
- (0, chai_1.expect)(contributions.snippets).to.deep.equal([{
686
+ expect(contributions.problemMatchers).to.deep.equal([{ name: 'sample-matcher' }]);
687
+ expect(contributions.problemPatterns).to.deep.equal([{ regexp: 'sample' }]);
688
+ expect(contributions.resourceLabelFormatters).to.deep.equal([{ scheme: 'file' }]);
689
+ expect(contributions.authentication).to.deep.equal([{ id: 'github', label: 'GitHub' }]);
690
+ expect(contributions.notebooks).to.deep.equal([{ type: 'sample-notebook', displayName: 'Notebook' }]);
691
+ expect(contributions.notebookRenderer).to.deep.equal([{ id: 'sample-renderer', displayName: 'Renderer' }]);
692
+ expect(contributions.notebookPreload).to.deep.equal([{ type: 'sample-preload' }]);
693
+ expect(contributions.snippets).to.deep.equal([{
696
694
  language: 'typescript',
697
695
  source: 'Orchestrator Extension',
698
696
  uri: 'hostedPlugin/acme_orchestrator/snippets/ts.json'
699
697
  }]);
700
- (0, chai_1.expect)(contributions.themes).to.deep.equal([{
698
+ expect(contributions.themes).to.deep.equal([{
701
699
  id: 'dark',
702
700
  label: 'Dark',
703
701
  uri: 'hostedPlugin/acme_orchestrator/themes/dark.json',
704
702
  description: undefined,
705
703
  uiTheme: undefined
706
704
  }]);
707
- (0, chai_1.expect)(contributions.colors).to.deep.equal([{
705
+ expect(contributions.colors).to.deep.equal([{
708
706
  id: 'sample.color',
709
707
  description: 'Sample',
710
708
  defaults: { light: '#fff', dark: '#000', hc: '#111' }
711
709
  }]);
712
- (0, chai_1.expect)(contributions.iconThemes).to.deep.equal([{
710
+ expect(contributions.iconThemes).to.deep.equal([{
713
711
  id: 'sample-icons',
714
712
  label: 'Icons',
715
713
  uri: 'hostedPlugin/acme_orchestrator/icons/theme.json',
716
714
  description: undefined,
717
715
  uiTheme: undefined
718
716
  }]);
719
- (0, chai_1.expect)(contributions.icons).to.deep.equal([{
717
+ expect(contributions.icons).to.deep.equal([{
720
718
  id: 'sample-icon',
721
719
  extensionId: 'acme.orchestrator',
722
720
  description: 'Sample icon',
723
721
  defaults: { id: 'other-icon' }
724
722
  }]);
725
- (0, chai_1.expect)(contributions.terminalProfiles).to.deep.equal([{ id: 'bash', title: 'Bash' }]);
726
- (0, chai_1.expect)(contributions.localizations).to.deep.equal([{
723
+ expect(contributions.terminalProfiles).to.deep.equal([{ id: 'bash', title: 'Bash' }]);
724
+ expect(contributions.localizations).to.deep.equal([{
727
725
  languageId: 'de',
728
726
  languageName: 'German',
729
727
  localizedLanguageName: undefined,
730
728
  minimalTranslations: undefined,
731
729
  translations: [{ id: 'package', path: './package.nls.de.json' }]
732
730
  }]);
733
- (0, chai_1.expect)(contributions.languages).to.deep.equal([{
731
+ expect(contributions.languages).to.deep.equal([{
734
732
  id: 'sample-lang',
735
733
  aliases: undefined,
736
734
  extensions: ['.sample'],
@@ -740,7 +738,7 @@ describe('normalize-contributions', () => {
740
738
  mimetypes: undefined,
741
739
  icon: undefined
742
740
  }]);
743
- (0, chai_1.expect)(contributions.grammars).to.deep.equal([{
741
+ expect(contributions.grammars).to.deep.equal([{
744
742
  language: 'sample-lang',
745
743
  scope: 'source.sample',
746
744
  format: 'json',
@@ -750,7 +748,7 @@ describe('normalize-contributions', () => {
750
748
  });
751
749
  it('merges aliased view container locations and reports async reader failures', async () => {
752
750
  const errors = [];
753
- const ctx = (0, test_helpers_1.createNormalizeCtx)({
751
+ const ctx = createNormalizeCtx({
754
752
  name: 'merge',
755
753
  contributes: {
756
754
  viewsContainers: {
@@ -771,8 +769,8 @@ describe('normalize-contributions', () => {
771
769
  errors.push({ kind, message });
772
770
  }
773
771
  });
774
- const contributions = await (0, normalize_contributions_1.normalizeContributions)(ctx, {});
775
- (0, chai_1.expect)(contributions.viewsContainers).to.deep.equal({
772
+ const contributions = await normalizeContributions(ctx, {});
773
+ expect(contributions.viewsContainers).to.deep.equal({
776
774
  left: [{
777
775
  id: 'left-a',
778
776
  title: 'A',
@@ -788,13 +786,13 @@ describe('normalize-contributions', () => {
788
786
  when: undefined
789
787
  }]
790
788
  });
791
- (0, chai_1.expect)(contributions).to.not.have.property('languages');
792
- (0, chai_1.expect)(contributions).to.not.have.property('grammars');
793
- (0, chai_1.expect)(errors.map(error => error.kind)).to.include.members(['languages', 'grammars']);
789
+ expect(contributions).to.not.have.property('languages');
790
+ expect(contributions).to.not.have.property('grammars');
791
+ expect(errors.map(error => error.kind)).to.include.members(['languages', 'grammars']);
794
792
  });
795
793
  it('continues after reader errors and reports them', async () => {
796
794
  const errors = [];
797
- const ctx = (0, test_helpers_1.createNormalizeCtx)({
795
+ const ctx = createNormalizeCtx({
798
796
  name: 'broken',
799
797
  contributes: {
800
798
  commands: [{ command: 'ok', title: 'OK' }],
@@ -808,17 +806,17 @@ describe('normalize-contributions', () => {
808
806
  errors.push({ kind, message });
809
807
  }
810
808
  });
811
- const contributions = await (0, normalize_contributions_1.normalizeContributions)(ctx, {});
812
- (0, chai_1.expect)(contributions).to.have.property('commands').with.lengthOf(1);
813
- (0, chai_1.expect)(contributions).to.have.property('configuration').that.is.empty;
814
- (0, chai_1.expect)(errors).to.have.lengthOf(1);
815
- (0, chai_1.expect)(errors[0].kind).to.equal('configuration');
816
- (0, chai_1.expect)(errors[0].message).to.be.instanceOf(Error);
809
+ const contributions = await normalizeContributions(ctx, {});
810
+ expect(contributions).to.have.property('commands').with.lengthOf(1);
811
+ expect(contributions).to.have.property('configuration').that.is.empty;
812
+ expect(errors).to.have.lengthOf(1);
813
+ expect(errors[0].kind).to.equal('configuration');
814
+ expect(errors[0].message).to.be.instanceOf(Error);
817
815
  });
818
816
  });
819
817
  describe('readWalkthroughs', () => {
820
818
  it('resolves media and plugin icon URLs for browser-only static hosting', async () => {
821
- const ctx = (0, test_helpers_1.createNormalizeCtx)({
819
+ const ctx = createNormalizeCtx({
822
820
  name: 'test-plugin',
823
821
  publisher: 'test-publisher',
824
822
  icon: 'images/icon.png',
@@ -836,18 +834,18 @@ describe('normalize-contributions', () => {
836
834
  }]
837
835
  }
838
836
  });
839
- const contributions = await (0, normalize_contributions_1.normalizeContributions)(ctx, {});
840
- (0, chai_1.expect)(contributions).to.have.property('walkthroughs').with.lengthOf(1);
837
+ const contributions = await normalizeContributions(ctx, {});
838
+ expect(contributions).to.have.property('walkthroughs').with.lengthOf(1);
841
839
  const walkthrough = contributions.walkthroughs[0];
842
- (0, chai_1.expect)(walkthrough.pluginId).to.equal('test-publisher.test-plugin');
843
- (0, chai_1.expect)(walkthrough.pluginIcon).to.equal('hostedPlugin/test_publisher_test_plugin/images/icon.png');
844
- (0, chai_1.expect)(walkthrough.steps[0].media).to.deep.equal({
840
+ expect(walkthrough.pluginId).to.equal('test-publisher.test-plugin');
841
+ expect(walkthrough.pluginIcon).to.equal('hostedPlugin/test_publisher_test_plugin/images/icon.png');
842
+ expect(walkthrough.steps[0].media).to.deep.equal({
845
843
  markdown: 'hostedPlugin/test_publisher_test_plugin/walkthroughs/open.md'
846
844
  });
847
845
  });
848
846
  it('skips walkthroughs with a missing id', () => {
849
847
  const warnings = [];
850
- const ctx = (0, test_helpers_1.createNormalizeCtx)({
848
+ const ctx = createNormalizeCtx({
851
849
  name: 'test-plugin',
852
850
  publisher: 'test-publisher',
853
851
  contributes: {
@@ -863,8 +861,8 @@ describe('normalize-contributions', () => {
863
861
  warnings.push(msg);
864
862
  }
865
863
  });
866
- (0, chai_1.expect)((0, normalize_contributions_1.readWalkthroughs)(ctx.plugin, ctx)).to.be.undefined;
867
- (0, chai_1.expect)(warnings).to.have.lengthOf(1);
864
+ expect(readWalkthroughs(ctx.plugin, ctx)).to.be.undefined;
865
+ expect(warnings).to.have.lengthOf(1);
868
866
  });
869
867
  });
870
868
  });