oc 0.50.60 → 0.50.62

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 (43) hide show
  1. package/.turbo/turbo-build.log +5 -5
  2. package/.turbo/turbo-lint.log +2 -2
  3. package/.turbo/turbo-test-silent.log +12 -11
  4. package/.turbo/turbo-test.log +1806 -1750
  5. package/CHANGELOG.md +13 -0
  6. package/README.md +16 -0
  7. package/dist/cli/domain/local.js +7 -4
  8. package/dist/components/oc-client/_package/package.json +4 -4
  9. package/dist/components/oc-client/_package/server.js +1 -1
  10. package/dist/components/oc-client/package.json +1 -1
  11. package/dist/index.d.ts +2 -2
  12. package/dist/registry/domain/events-handler.d.ts +2 -5
  13. package/dist/registry/domain/http-server/express-adapter.d.ts +2 -2
  14. package/dist/registry/domain/http-server/express-adapter.js +47 -2
  15. package/dist/registry/domain/http-server/types.d.ts +21 -7
  16. package/dist/registry/domain/options-sanitiser.d.ts +8 -2
  17. package/dist/registry/domain/options-sanitiser.js +2 -0
  18. package/dist/registry/domain/plugins-initialiser.js +41 -5
  19. package/dist/registry/domain/repository.js +100 -19
  20. package/dist/registry/domain/validators/registry-configuration.d.ts +5 -2
  21. package/dist/registry/domain/validators/registry-configuration.js +5 -0
  22. package/dist/registry/index.d.ts +11 -6
  23. package/dist/registry/index.js +107 -28
  24. package/dist/registry/middleware/cors.d.ts +4 -0
  25. package/dist/registry/middleware/cors.js +62 -4
  26. package/dist/registry/router.js +4 -2
  27. package/dist/registry/routes/component-info.js +3 -2
  28. package/dist/registry/routes/component-preview.js +3 -2
  29. package/dist/registry/routes/component.d.ts +2 -1
  30. package/dist/registry/routes/component.js +1 -2
  31. package/dist/registry/routes/components.d.ts +2 -1
  32. package/dist/registry/routes/components.js +1 -2
  33. package/dist/registry/routes/helpers/get-component.d.ts +2 -1
  34. package/dist/registry/routes/helpers/get-component.js +7 -8
  35. package/dist/registry/routes/index.js +11 -7
  36. package/dist/resources/index.d.ts +5 -1
  37. package/dist/resources/index.js +5 -1
  38. package/dist/types.d.ts +34 -5
  39. package/dist/utils/bounded-cache.d.ts +10 -0
  40. package/dist/utils/bounded-cache.js +31 -0
  41. package/js-library-optimization-playbook.md +1379 -0
  42. package/package.json +4 -3
  43. package/tsconfig.types.json +10 -0
@@ -1,1750 +1,1806 @@
1
-
2
- 
3
- > oc@0.50.58 test
4
- > node tasks/mochaTest.js
5
-
6
- compiling component /Users/Ricardo.Agullo/Work/opencomponents/oc/packages/oc/test/fixtures/components/circular-json-error
7
- compiling component /Users/Ricardo.Agullo/Work/opencomponents/oc/packages/oc/test/fixtures/components/container-with-multiple-nested
8
- compiling component /Users/Ricardo.Agullo/Work/opencomponents/oc/packages/oc/test/fixtures/components/container-with-nested
9
- compiling component /Users/Ricardo.Agullo/Work/opencomponents/oc/packages/oc/test/fixtures/components/empty
10
- compiling component /Users/Ricardo.Agullo/Work/opencomponents/oc/packages/oc/test/fixtures/components/hello-world
11
- compiling component /Users/Ricardo.Agullo/Work/opencomponents/oc/packages/oc/test/fixtures/components/hello-world-custom-cookies
12
- compiling component /Users/Ricardo.Agullo/Work/opencomponents/oc/packages/oc/test/fixtures/components/hello-world-custom-headers
13
- compiling component /Users/Ricardo.Agullo/Work/opencomponents/oc/packages/oc/test/fixtures/components/jade-filters
14
- compiling component /Users/Ricardo.Agullo/Work/opencomponents/oc/packages/oc/test/fixtures/components/language
15
- compiling component /Users/Ricardo.Agullo/Work/opencomponents/oc/packages/oc/test/fixtures/components/lodash-component
16
- compiling component /Users/Ricardo.Agullo/Work/opencomponents/oc/packages/oc/test/fixtures/components/no-containers
17
- compiling component /Users/Ricardo.Agullo/Work/opencomponents/oc/packages/oc/test/fixtures/components/welcome
18
- compiling component /Users/Ricardo.Agullo/Work/opencomponents/oc/packages/oc/test/fixtures/components/welcome-with-optional-parameters
19
- Test components packaged 👍
20
-
21
- 
22
-  utils : put
23
-  when the registry edge resets streamed uploads over HTTP/2
24
- (node:98496) Warning: Setting the NODE_TLS_REJECT_UNAUTHORIZED environment variable to '0' makes TLS connections and HTTPS requests insecure by disabling certificate verification.
25
- (Use `node --trace-warnings ...` to show where the warning was created)
26
-  ✔ uploads successfully by falling back to HTTP/1.1
27
-
28
-  The targz dependency
29
-  when compressing a folder with targz
30
-  ✔ should create the file
31
-  when decompressing the created file
32
-  ✔ should throw no error
33
-  ✔ should contain the files
34
-
35
-  cli : domain : clean
36
-  when fetching the list of folders to clean
37
-  happy path
38
-  ✔ should return no error
39
-  ✔ should return the list
40
-  getComponentsByDir error
41
-  ✔ should return error
42
-  when removing the folders to clean
43
-  happy path
44
-  ✔ should return no error
45
-  ✔ should remove all the folders
46
-  fs.remove error
47
-  ✔ should return the error
48
-  ✔ should try removing all the folders
49
-
50
-  cli : domain : get-components-by-dir
51
-  when getting components from dir
52
-  ✔ should not error
53
-  ✔ should get the correct list
54
-  when reading a broken package.json
55
-  ✔ should not error
56
-  ✔ should get the correct list
57
-  when finds no components
58
-  ✔ should not error
59
-  ✔ should get an empty list
60
-  when components are filtered
61
-  ✔ should not error
62
-  ✔ should get an the filtered list
63
-
64
-  cli : domain : get-mocked-plugins
65
-  when setting up mocked plugins
66
-  when componentsDir parameter is undefined
67
-  ✔ should use . as default
68
-  when componentsDir parameter is omitted
69
-  ✔ should use . as default
70
-  when oc.json is in both root and component folder
71
-  ✔ should return plugins from the provided components folder config
72
-  when oc.json is missing
73
-  ✔ should return an empty array
74
-  when no plugins are specified
75
-  ✔ should return an empty array
76
-  when a static plugin is specified
77
-  ✔ should return the static plugin
78
-  ✔ should set up the execute method to return the specified value
79
-  when a dynamic plugin with a function signature is specified
80
-  ✔ should return the dynamic plugin
81
-  ✔ should set up the execute method to run the module
82
-  when a dynamic plugin with an object signature is specified
83
-  ✔ should return the dynamic plugin
84
-  ✔ should set up the execute method to run the module
85
-  when a dynamic plugin is specified and the referenced file is missing
86
-  ✔ should log an error
87
-  ✔ should omit the broken plugin from the results
88
-  when a dynamic plugin is specified and the module is not a function
89
-  ✔ should log an error
90
-  ✔ should omit the broken plugin from the results
91
-
92
-  cli : domain : handle-dependencies : ensure-compiler-is-declared-as-devDependency
93
-  when compiler is declared as devDependency
94
-  ✔ should return no error
95
-  ✔ should return the compiler dependency
96
-  when compiler is not declared as devDependency
97
-  ✔ should return the error
98
-
99
-  cli : domain : handle-dependencies : get-compiler
100
-  when compiler is already installed inside the component's folder
101
-  ✔ should try to require it from the component's path
102
-  ✔ should return no error
103
-  ✔ should not try to install it
104
-  when compiler is not installed inside the component's folder
105
-  when compiler version is specified
106
-  ✔ should return no error
107
-  ✔ should install it
108
-  when compiler version is not specified
109
-  ✔ should return no error
110
-  ✔ should install it
111
-  when install fails
112
-  ✔ should return the error
113
-
114
-  cli : domain : handle-dependencies - get-missing-dependencies
115
-  When dependencies: {"lodash":"1.2.3","underscore":""} and installed: {"lodash":true,"underscore":false}
116
-  ✔ should output ["underscore@latest"]
117
-  ✔ should resolve the dependency relative to where the oc cli is running
118
-  When dependencies: {"lodash":"1.2.3","underscore":"4.5.6"} and installed: {"lodash":true,"underscore":false}
119
-  ✔ should output ["underscore@4.5.6"]
120
-  ✔ should resolve the dependency relative to where the oc cli is running
121
-  When dependencies: {"lodash":"1.2.3","underscore":""} and installed: {"lodash":true,"underscore":true}
122
-  ✔ should output []
123
-  ✔ should resolve the dependency relative to where the oc cli is running
124
-
125
-  cli : domain : handle-dependencies : install-compiler
126
-  when succeeds
127
-  ✔ should run npm install with correct parameters
128
-  ✔ should return no error
129
-  ✔ should return the compiler
130
-  ✔ should log progress
131
-  when install fails
132
-  ✔ should return an error
133
-  ✔ should log progress
134
-  when install succeeds but validation fails
135
-  ✔ should return an error
136
-  ✔ should log progress
137
-
138
-  cli : domain : handle-dependencies : install-missing-dependencies
139
-  when there is no missing dependency
140
-  ✔ should return no error
141
-  ✔ should not install anything
142
-  when there are missing dependencies and install succeeds
143
-  ✔ should return no error
144
-  ✔ should install the missing dependencies
145
-  ✔ should log progress
146
-  when there are missing dependencies and install fails
147
-  ✔ should return the error
148
-  ✔ should log progress
149
-  when there are missing dependencies and install succeeds but the dependencies are still not requireable
150
-  ✔ should return the error
151
-  ✔ should log progress
152
-
153
-  cli : domain : handle-dependencies : require-template
154
-  when requiring template
155
-  when module not found
156
-  ✔ should try requiring from component folder first
157
-  ✔ should try requiring it as absolute as second attempt
158
-  ✔ should try requiring it relatively to the oc runtime as third attempt
159
-  ✔ should try requiring it relatively to the oc cli as fourth attempt
160
-  ✔ should then throw an exeption
161
-  when template is legacy (jade)
162
-  ✔ should require the oc-template-jade instead
163
-  ✔ should return the template
164
-  when template is legacy (handlebars)
165
-  ✔ should require the oc-template-handlebars instead
166
-  ✔ should return the template
167
-  when requiring a compiler (oc-template-react)
168
-  ✔ should require the oc-template-react-compiler
169
-  ✔ should return the template
170
-  when module found in the component's folder
171
-  when the template is valid
172
-  ✔ should return the template
173
-  when the template is not valid
174
-  ✔ should throw an error
175
-
176
-  cli : domain : handle-dependencies
177
-  happy path
178
-  when packaging
179
-  ✔ should return no error
180
-  ✔ should return modules plus the node.js core modules
181
-  ✔ should return templates
182
-  ✔ should log progress
183
-  ✔ should make sure compilers are declared as devDependencies
184
-  ✔ should fetch the compilers
185
-  ✔ should install the dependencies if missing
186
-  when in dev mode
187
-  ✔ should not install the dependencies if missing
188
-
189
-  cli : domain : init-template : install-template
190
-  when succeeds
191
-  ✔ should spawn the right process
192
-  ✔ should validate the template
193
-  ✔ should return no error
194
-  ✔ should log progress and success
195
-
196
-  cli : domain : init-template
197
-  happy path
198
-  ✔ should return no error
199
-  ✔ should call ensureDir with correct params
200
-  ✔ should call npm init with correct parameters
201
-  ✔ should call installTemplate with correct parameters
202
-  ✔ should call scaffold with correct parameters
203
-  ✔ should call npm install with correct parameters
204
-  when component folder creation fails
205
-  ✔ should return an error
206
-  when npm init fails
207
-  ✔ should return an error
208
-  when template compiler installation fails
209
-  ✔ should return an error
210
-  when template compiler installation fails
211
-  ✔ should return an error
212
-
213
-  cli : domain : mock
214
-  when mocking a static plugin
215
-  ✔ should add mock to oc.json
216
-  when mocking a static plugin using a bool value
217
-  ✔ should add mock to oc.json
218
-  when mocking a dynamic plugin
219
-  ✔ should add mock to oc.json
220
-
221
-  cli : domain : ocConfig
222
-  getOcConfig
223
-  when config file exists and is valid JSON
224
-  ✔ should return parsed config with registries
225
-  ✔ should return parsed config with development plugins
226
-  ✔ should return parsed config with fallback settings
227
-  ✔ should include sourcePath in result
228
-  ✔ should use default config file path when no path provided
229
-  ✔ should use provided path when specified
230
-  when config has deprecated mocks structure
231
-  ✔ should merge deprecated mocks into development plugins
232
-  when config has both mocks and development plugins
233
-  ✔ should prioritize development plugins over deprecated mocks
234
-  when config has no registries
235
-  ✔ should return empty registries array
236
-  when config has no development section
237
-  ✔ should return empty plugins object
238
-  when config file does not exist
239
-  ✔ should return default config
240
-  when config file contains invalid JSON
241
-  ✔ should return default config
242
-  when oc.json is in both root and component folder
243
-  ✔ should use components folder oc.json as default
244
-  when oc.json is in root folder but not component folder
245
-  ✔ should use root oc.json
246
-  setOcConfig
247
-  when setting valid config
248
-  ✔ should write config to file
249
-  ✔ should use default config file path when no path provided
250
-  ✔ should write stringified JSON with proper formatting
251
-  when setting config with custom path
252
-  ✔ should use provided path
253
-  when setting config with mocks structure
254
-  ✔ should merge mocks into development plugins
255
-  when setting config with fallback settings
256
-  ✔ should preserve fallback settings
257
-
258
-  cli : domain : package-components
259
-  when packaging
260
-  when component is valid
261
-  ✔ should add sizes and correctly invoke the callback when template succeed packaging
262
-  when component parameters are not valid
263
-  ✔ should add version to package.json file
264
-  when component name is not valid
265
-  ✔ should add version to package.json file
266
-
267
-  cli : domain : registry
268
-  registry specified at runtime
269
-  ✔ should use the registry specified
270
-  when adding registry
271
-  when registry does not end with "/"
272
-  ✔ should append the slash when doing the request
273
-  ✔ should save the file with slashed url
274
-  when publishing to registry
275
-  when no credentials used
276
-  ✔ should do the request without authorization header
277
-  ✔ should do the request with user-agent including cli version and node details
278
-  when credentials used
279
-  ✔ should do the request with authorization header
280
-  ✔ should do the request with user-agent including cli version and node details
281
-  when getting preview url
282
-  when href not valid
283
-  ✔ should show error message
284
-  when href = /component
285
-  ✔ href should be /component/~preview/
286
- (node:98496) [DEP0169] DeprecationWarning: `url.parse()` behavior is not standardized and prone to errors that have security implications. Use the WHATWG URL API instead. CVEs are not issued for `url.parse()` vulnerabilities.
287
-  when href = /component/1.X.X
288
-  ✔ href should be /component/1.X.X/~preview/
289
-  when href = /component?hello=world
290
-  ✔ href should be /component/~preview/?hello=world
291
-  when href = /component/?hello=world
292
-  ✔ href should be /component/~preview/?hello=world
293
-  when href = /component/1.X.X?hello=world
294
-  ✔ href should be /component/1.X.X/~preview/?hello=world
295
-  when href = /component/1.X.X/?hello=world
296
-  ✔ href should be /component/1.X.X/~preview/?hello=world
297
-
298
-  cli : domain : url-parser
299
-  when parsing http://www.registry.com/api/v2/component-name
300
-  ✔ name should be component-name
301
-  ✔ version should be blank
302
-  ✔ registryUrl should be http://www.registry.com/api/v2/
303
-  ✔ parameters should be {}
304
-  ✔ clientHref should be http://www.registry.com/api/v2/oc-client/client.js
305
-  when parsing http://www.registry.com/component-name/~1.0.0/?hello=world
306
-  ✔ name should be component-name
307
-  ✔ version should be ~1.0.0
308
-  ✔ registryUrl should be http://www.registry.com/
309
-  ✔ parameters should be { hello: 'world'}
310
-  ✔ clientHref should be http://www.registry.com/oc-client/client.js
311
-  when parsing http://www.registry.com/12345/~1.0.0?hello=world
312
-  ✔ name should be 12345
313
-  ✔ version should be ~1.0.0
314
-  ✔ registryUrl should be http://www.registry.com/
315
-  ✔ parameters should be { hello: 'world'}
316
-  ✔ clientHref should be http://www.registry.com/oc-client/client.js
317
-
318
-  cli : domain : watch
319
-  when a file from a component changes
320
-  ✔ should return no error
321
-  ✔ should return the fileName
322
-  ✔ should return the component folder
323
-  when a file from a component whose name matches another component changes
324
-  ✔ should return no error
325
-  ✔ should return the fileName
326
-  ✔ should return the component folder
327
-  when a file from a component on Windows-like path changes
328
-  ✔ should return no error
329
-  ✔ should return the fileName
330
-  ✔ should return the component folder
331
-
332
-  cli : facade : clean
333
-  when cleaning folder
334
-  when folder is already clean
335
-  ✔ should show a message
336
-  ✔ shouldn't call local.remove
337
-  when folder needs cleaning and --yes flag passed down
338
-  ✔ should show a message before removing
339
-  ✔ should remove the folder
340
-  ✔ should show a message when done
341
-  when folder needs cleaning and no --yes flag passed down and users says yes
342
-  ✔ should show a message before removing
343
-  ✔ should prompt the user to confirm
344
-  ✔ should then remove the folder
345
-  ✔ should show a message when done
346
-  when folder needs cleaning and no --yes flag passed down and users says no
347
-  ✔ should show a message before removing
348
-  ✔ should prompt the user to confirm
349
-  ✔ shouldn't remove the folder
350
-  when removing causes an error
351
-  ✔ should show a message before removing
352
-  ✔ should try removing the folder
353
-  ✔ should show an error message at the end
354
-
355
-  cli : facade : dev
356
-  when running a dev version of the registry
357
-  when the directory is not found
358
-  ✔ should show an error
359
-  when the directory does not contain any valid component
360
-  ✔ should show an error
361
-  when testing livereload refresh sequencing bugfix
362
-  ✔ should call refreshLiveReload AFTER packageComponents completes
363
-  ✔ should handle both single component and all components refresh sequencing
364
-
365
-  cli : facade : init
366
-  when initialising a new component
367
-  when the component is an empty string
368
-  ✔ should show an error
369
-  when the component has a non valid name
370
-  ✔ should show an error
371
-  when the template is of a non valid type
372
-  ✔ should show an error
373
-  when an error happens
374
-  ✔ should show an error
375
-  when the component has relative path
376
-  ✔ should show a correct name in the log message
377
-  ✔ should show a correct path in the log message
378
-  when succeeds
379
-  ✔ should show a message
380
-
381
-  cli : facade : mock
382
-  when mocking plugin
383
-  when it succeeds
384
-  ✔ should show a confirmation message
385
-
386
-  cli : facade : package
387
-  before packaging a component
388
-  ✔ should always show a message
389
-  when packaging
390
-  when a component is not valid
391
-  ✔ should show an error
392
-  when a component is valid
393
-  ✔ should package and show success message
394
-  when creating tar.gz archive
395
-  ✔ should not compress when option set to false
396
-  when compression is successful
397
-  ✔ should show a message for success
398
-  when compression fails
399
-  ✔ should show a message for failure
400
-
401
-  cli : facade : preview
402
-  when previewing not valid component
403
-  ✔ should not open any preview
404
-  ✔ should show error message
405
-  when previewing valid component
406
-  ✔ should open /component/~preview/
407
-
408
-  cli : facade : publish
409
-  when publishing component
410
-  when api is not valid
411
-  ✔ should show an error
412
-  when api is valid
413
-  ✔ should show a message
414
- compiling component /Users/Ricardo.Agullo/Work/opencomponents/oc/packages/oc/test/fixtures/components/hello-world
415
-  ✔ should take precedence over the registries set through oc.json
416
-  when packaging
417
-  when a component is not valid
418
-  ✔ should show an error
419
-  when a component is valid
420
-  when creating tar.gz archive
421
-  ✔ should show a message
422
-  when publishing
423
-  ✔ should show a message
424
-  ✔ should publish to all registries
425
-  ✔ should pass supplied credentials on the first publish attempt
426
-  when a generic error happens
427
-  ✔ should show an error
428
-  when a generic error happens from the api
429
-  ✔ should show an error
430
-  when using an old cli
431
-  ✔ should show an error
432
-  when using an old node version
433
-  ✔ should show an error
434
-  when registry requires authentication
435
-  ✔ should prompt for credentials
436
-  when credentials are prepopulated
437
-  ✔ should not prompt for credentials
438
-  when it succeeds
439
-  ✔ should show a message
440
-  ✔ should remove the compressed package
441
-  when skipping packaging
442
-  ✔ should publish the package to all registries
443
-  ✔ should skip packaging
444
-  ✔ should show an error message if the package folder does not exist
445
-
446
-  cli : facade : registry : add
447
-  when adding a not valid registry
448
-  ✔ should show the error
449
-  when adding a valid registry
450
-  ✔ should show a confirmation message
451
-
452
-  cli : facade : registry : ls
453
-  when no registries linked to the app
454
-  ✔ should introduce the list of registries
455
-  ✔ should log an error
456
-  when registries linked to the app
457
-  ✔ should introduce the list of registries
458
-  ✔ should list the linked registries
459
-
460
-  cli : facade : registry : migrate-metadata
461
-  ✔ should backfill metadata from the configured registry storage
462
-  ✔ should load native ESM registry config modules
463
-  ✔ should pass top-level manageSchema to the configured metadata adapter
464
-  ✔ should scan storage directories when components-details.json is missing
465
-  ✔ should close the metadata store even when backfill fails
466
-  ✔ should fail when metadata config is missing
467
-
468
-  cli : facade : registry : remove
469
-  when removing a registry and having some problem removing it
470
-  ✔ should show the error
471
-  when removing a valid registry
472
-  ✔ should show a confirmation message
473
-
474
-  cli : facade : validate
475
-  when validating a component
476
-  when validation succeeds
477
-  ✔ should get registries
478
-  ✔ should package the component
479
-  ✔ should validate against registry
480
-  ✔ should log success message
481
-  when skipPackage option is used
482
-  ✔ should not package the component
483
-  ✔ should validate against registry
484
-  when validation fails
485
-  ✔ should throw an error
486
-  when multiple registries are provided
487
-  ✔ should not call registry.get
488
-  ✔ should validate against both registries
489
-
490
-  cli : programmatic-api
491
-  cmd: cli.dev
492
-  ✔ should be function
493
-  ✔ should correctly wrap the related facade
494
-  cmd: cli.init
495
-  ✔ should be function
496
-  ✔ should correctly wrap the related facade
497
-  cmd: cli.mock
498
-  ✔ should be function
499
-  ✔ should correctly wrap the related facade
500
-  cmd: cli.package
501
-  ✔ should be function
502
-  ✔ should correctly wrap the related facade
503
-  cmd: cli.publish
504
-  ✔ should be function
505
-  ✔ should correctly wrap the related facade
506
-  cmd: cli.preview
507
-  ✔ should be function
508
-  ✔ should correctly wrap the related facade
509
-  cmd: cli.registry.add
510
-  ✔ should be function
511
-  ✔ should correctly wrap the related facade
512
-  cmd: cli.registry.ls
513
-  ✔ should be function
514
-  ✔ should correctly wrap the related facade
515
-  cmd: cli.registry.remove
516
-  ✔ should be function
517
-  ✔ should correctly wrap the related facade
518
-
519
-  cli : validate-command : valid
520
-  given "registry add"
521
-  ✔ "registry" should be a valid command
522
-  given "registry add"
523
-  ✔ "add" should be a valid command
524
-  given "registry ls"
525
-  ✔ "ls" should be a valid command
526
-
527
-  cli : validate-command : invalid
528
-  given "foo bar"
529
-  ✔ "foo" should be an invalid command
530
-  given "registry bar"
531
-  ✔ "bar" should be an invalid command
532
-
533
-  registry : app-start
534
-  when registry starting
535
-  when not in local mode
536
-  when oc-client found on library
537
-  ✔ should not publish it
538
-  when oc-client not found on library
539
-  ✔ should publish it
540
-
541
-  registry : domain : components-cache
542
-  when library does not contain components.json
543
-  when getting the json fails
544
-  ✔ should throw with the error message
545
-  when initialising the cache
546
-  ✔ should try fetching the components.json and check components
547
-  ✔ should scan for directories to fetch components and versions
548
-  ✔ should then save the directories' data to components.json file in cdn
549
-  ✔ should start the refresh loop
550
-  when library contains outdated components.json
551
-  when initialising the cache
552
-  ✔ should fetch the components.json
553
-  ✔ should verify new versions
554
-  ✔ should ignore corrupted versions and generate an error event
555
-  ✔ should scan for directories to fetch components and versions
556
-  ✔ should then save the directories' data to components.json file in cdn
557
-  ✔ should start the refresh loop
558
-  when library contains updated components.json
559
-  when initialising the cache
560
-  ✔ should fetch the components.json
561
-  ✔ should scan for directories to fetch components and versions
562
-  ✔ should not modify components.json
563
-  ✔ should use it as a source of truth
564
-  ✔ should start the refresh loop
565
-  when refreshing the cache
566
-  when refresh errors
567
-  ✔ should generate an error event
568
-  when refresh does not generate errors
569
-  ✔ should have started, stopped and restarted the refresh loop
570
-  ✔ should do list requests to cdn
571
-  ✔ should do write request to cdn
572
-  ✔ should refresh the values
573
-  when metadata store is configured
574
-  ✔ should hydrate the cache from the metadata store
575
-  ✔ should read the latest metadata snapshot on get
576
-  ✔ should not scan or write storage metadata files
577
-  ✔ should keep serving cached metadata when polling fails
578
-  ✔ should not restart the polling loop when closed during a poll
579
-
580
-  registry : domain : metadata-index
581
-  ✔ should reuse the hydrated snapshot until refreshed
582
-  ✔ should update the hydrated snapshot when a row is added
583
-
584
-  registry : domain : components-details
585
-  get()
586
-  when details file exists on cdn
587
-  ✔ should not error
588
-  ✔ should return the details
589
-  ✔ should fetch the details from components-details.json
590
-  ✔ should cache the details after the first fetch
591
-  when details file does not exist on cdn
592
-  ✔ should return an error
593
-  refresh()
594
-  when details file exists on cdn
595
-  when details file is outdated on cdn
596
-  ✔ should fetch the component details for new components
597
-  when component details fetch fails
598
-  ✔ should return an error
599
-  ✔ should fire an error event
600
-  when component details fetch succeeds
601
-  ✔ should save the updated component details to file
602
-  when component details save fails
603
-  ✔ should return an error
604
-  ✔ should fire an error event
605
-  when component details save succeeds
606
-  ✔ should not error
607
-  ✔ should return result
608
-  ✔ should cache the refreshed details
609
-  when details file is up-to-date on cdn
610
-  ✔ should not error
611
-  ✔ should not save it
612
-  ✔ should return the result
613
-  when details file does not exist on cdn
614
-  ✔ should fetch the component details for new components
615
-  when component details fetch fails
616
-  ✔ should return an error
617
-  ✔ should fire an error event
618
-  when component details fetch succeeds
619
-  ✔ should save the updated component details to file
620
-  when component details save fails
621
-  ✔ should return an error
622
-  ✔ should fire an error event
623
-  when component details save succeeds
624
-  ✔ should not error
625
-  ✔ should return result
626
-  polling
627
-  ✔ should start the polling loop using the configured interval
628
-  ✔ should clear the previous loop when refreshing again
629
-  ✔ should restart the loop after each poll
630
-  ✔ should not restart the polling loop when closed during a poll
631
-  ✔ should update the cache when the polled data is newer
632
-  ✔ should keep the cached data when the polled data is not newer
633
-  ✔ should fire an error event when polling fails
634
-  when metadata store is configured
635
-  ✔ should hydrate the details from the metadata store
636
-  ✔ should not read or write storage metadata files
637
-  ✔ should not start a second polling loop
638
-
639
-  registry : domain : events-handler
640
-  when requiring it multiple times
641
-  ✔ should be a singleton
642
-  when firing an event that has multiple subscribers
643
-  ✔ should call the subscribers in the correct order
644
-  ✔ should call the subscribers with the event payload
645
-  when subscribing a request event using a not valid handler
646
-  ✔ should throw an error
647
-  when unsubscribing a request event
648
-  ✔ should throw an error if callback is not a function
649
-  ✔ should not throw an error if event name is not registered
650
-  ✔ should remove the specific callback but not the others
651
-
652
-  registry : domain : extract-package
653
-  when successfully extracting package
654
-  ✔ should decompress tar.gz file
655
-  ✔ should respond
656
-  when extracting package fails
657
-  ✔ should respond with error
658
-
659
-  registry : domain : metadata-index
660
-  getComponentsListFromRows()
661
-  ✔ should group versions per component and sort them by semver
662
-  ✔ should derive lastEdit from the most recent publishDate
663
-  ✔ should produce lastEdit 0 for an empty registry
664
-  getComponentsDetailsFromRows()
665
-  ✔ should map rows to per-version details and omit absent templateSize
666
-  getComponentRow()
667
-  ✔ should build a row from a package.json component
668
-  ✔ should default publishDate to 0 when the component has no date
669
-  createMetadataIndex()
670
-  refresh() / get() / getOrRefresh()
671
-  ✔ should hydrate both caches from a single getAllComponents call
672
-  ✔ get() should return undefined before any hydration
673
-  ✔ getOrRefresh() should hydrate once then reuse the snapshot
674
-  ✔ should skip full rehydration when the metadata change token is unchanged
675
-  ✔ should rehydrate when the metadata change token changes
676
-  ✔ should force a periodic full rehydration even when the token is unchanged
677
-  ✔ should ignore a stale refresh result when a local add lands while it is in flight
678
-  add()
679
-  ✔ should build a snapshot from a single row when none exists yet
680
-  ✔ should append a new version to an existing component in semver order
681
-  ✔ should add a brand-new component without touching others
682
-  ✔ should be a no-op when the version already exists
683
-  ✔ should not advance lastEdit backwards
684
-  ✔ should not mutate a previously returned snapshot (immutability)
685
-  ✔ should share untouched component entries by reference with the new snapshot
686
-
687
-  registry : domain : metadata-migration
688
-  getComponentRowsFromComponentsDetails()
689
-  ✔ should map components-details.json content to metadata rows
690
-  backfillMetadataRows()
691
-  ✔ should insert rows into the metadata store
692
-  ✔ should treat existing metadata rows as skipped
693
-  ✔ should insert rows concurrently with a bounded limit
694
-  ✔ should treat active metadata reservations as skipped
695
-  ✔ should rethrow non-idempotent metadata insert errors
696
-  backfillMetadataFromComponentsDetails()
697
-  ✔ should backfill rows from components details
698
-  exportLegacyMetadataFiles()
699
-  ✔ should export metadata rows to legacy components files
700
-  getComponentRowsFromStorageDirectories()
701
-  ✔ should map component package.json files from storage directories to metadata rows
702
-  ✔ should return no rows when the components directory does not exist
703
-  backfillMetadataFromStorageDetails()
704
-  ✔ should read components-details.json from storage and backfill rows
705
-  ✔ should scan storage directories when components-details.json is missing
706
-
707
-  registry : routes : helpers : nested-renderer
708
-  when rendering nested component
709
-  when req is not valid
710
-  when componentName not valid
711
-  ✔ should throw an error
712
-  when componentName empty
713
-  ✔ should throw an error
714
-  when requesting a not existent component
715
-  ✔ should return an error in the callback
716
-  when req is valid
717
-  when all params specified
718
-  ✔ should get the html result
719
-  ✔ should make correct request to renderer
720
-  ✔ should get no error
721
-  when minimal params specified
722
-  ✔ should get the html result
723
-  ✔ should make correct request to renderer
724
-  ✔ should get no error
725
-  when rendering nested components
726
-  when req is not valid
727
-  when components not valid
728
-  ✔ should throw an error
729
-  when components empty
730
-  ✔ should throw an error
731
-  when requesting not existent components
732
-  ✔ should return no error in the callback
733
-  ✔ should return error in result callback
734
-  when req is valid
735
-  when all params specified
736
-  ✔ should get the html result
737
-  ✔ should make correct request to renderer
738
-  ✔ should get no error
739
-  when minimal params specified
740
-  ✔ should get the html result
741
-  ✔ should make correct request to renderer
742
-  ✔ should get no error
743
-
744
-  registry : domain : options-sanitiser
745
-  when options is empty
746
-  ✔ should set prefix to "/" (398ms)
747
-  ✔ should set tempDir to "./temp/" (245ms)
748
-  ✔ should set hotReloading to false (121ms)
749
-  ✔ should set verbosity to 0 (191ms)
750
-  ✔ should set customHeadersToSkipOnWeakVersion to [] (114ms)
751
-  ✔ should set timeout to 120000 (139ms)
752
-  ✔ should default to the Express HTTP server adapter (263ms)
753
-  server adapter configuration
754
-  when no server adapter is provided
755
-  ✔ should default to the Express HTTP server adapter (90ms)
756
-  when no server options are provided
757
-  ✔ should pass the port to the server options (88ms)
758
-  when server options are provided
759
-  ✔ should leave them untouched (77ms)
760
-  when verbosity is provided
761
-  ✔ should leave value untouched (77ms)
762
-  customHeadersToSkipOnWeakVersion
763
-  when it contains valid elements
764
-  ✔ should convert the array elements to lower case (75ms)
765
-  fallbackRegistryUrl
766
-  when fallbackRegistryUrl doesn't contain / at the end of url
767
-  ✔ should add `/` at the end of url (88ms)
768
-  when fallbackRegistryUrl contains `/` at the end of url
769
-  ✔ should not modify fallbackRegistryUrl url (191ms)
770
-  prefix and baseUrl sanitization
771
-  ✔ should support various scenarios correctly (936ms)
772
-  when pollingInterval
773
-  is provided
774
-  ✔ should not modify it (56ms)
775
-  is not provided
776
-  ✔ should initialize it as 5000 (56ms)
777
-  when templates
778
-  is provided
779
-  ✔ should not modify it
780
-  is not provided
781
-  ✔ should initialize it as 5000 (57ms)
782
-  when env
783
-  is provided
784
-  ✔ should not modify it (59ms)
785
-  is not provided
786
-  ✔ should initialize it as an empty {} (59ms)
787
-  storage adapter configuration
788
-  when legacy "s3" param
789
-  is provided
790
-  ✔ should create a storage.adapter configuration accordingly (310ms)
791
-  when no storage adapter
792
-  is provided
793
-  ✔ should default to the oc-s3-storage-adapter (66ms)
794
-  when refreshInterval
795
-  is provided
796
-  ✔ should pass the refreshInterval to the storage options (64ms)
797
-  when verbosity
798
-  is provided
799
-  ✔ should pass the verbosity to the storage options (59ms)
800
-  when storage.path
801
-  does not include a protocol
802
-  ✔ should sanitize the path to rely on the https protocol (64ms)
803
-  does include a prefix
804
-  ✔ should not modify it (66ms)
805
-
806
-  registry : domain : plugins-initialiser
807
-  when initialising not valid plugins
808
-  when plugin not registered correctly
809
-  ✔ should error
810
-  when plugin is anonymous
811
-  ✔ should error
812
-  when plugin does not expose a register method
813
-  ✔ should error
814
-  when plugin does not expose an execute method
815
-  ✔ should error
816
-  when initialising valid plugins
817
-  ✔ should register plugin with passed options
818
-  ✔ should expose the functionalities using the plugin names
819
-  ✔ should expose descriptions on the plugin functions if defined
820
-  ✔ should be make the functionality usable
821
-  when plugin specifies dependencies
822
-  ✔ should provide the getValue register method with the required dependent plugins
823
-  when plugins have a circular dependency
824
-  ✔ should throw an error
825
-  when plugin depends on a plugin that is not registered
826
-  ✔ should throw an error
827
-  when plugin chain requires multiple passes
828
-  ✔ should defer the initalisation of the plugin until all dependencies have bee registered
829
-
830
-  registry : domain : register-templates
831
-  when templates get registered without additional templates
832
-  ✔ should correctly register core-templates
833
-  when templates get registered with additional templates
834
-  ✔ should correctly register core-templates & extra templates
835
-  ✔ should replace the devurl for the url field
836
-  and additional template is already part of core-templates
837
-  ✔ should correctly register core-templates only
838
-
839
-  registry : domain : repository
840
-  when on cdn configuration
841
-  when getting the list of available components
842
-  ✔ should fetch the list from the cache
843
-  ✔ should respond without an error
844
-  ✔ should list the components
845
-  when getting the components details
846
-  ✔ should not error
847
-  ✔ should return the result
848
-  when getting the list of supported templates
849
-  when no templates are specificed on the configuaration
850
-  ✔ should return core templates
851
-  when the templates specificed on the configuaration are core-templates
852
-  ✔ should only return uniques templates
853
-  when templates specificed on the configuaration are not installed
854
-  ✔ should throw an error
855
-  when trying to get a not valid component
856
-  when the component does not exist
857
-  ✔ should respond with a proper error
858
-  when the get component info fails
859
-  ✔ should respond with a proper error
860
-  when the component exists but version does not
861
-  ✔ should respond with a proper error
862
-  when getting an existing component
863
-  ✔ should respond without an error
864
-  ✔ should fetch the versions' list from the cache
865
-  ✔ should fetch the component info from the correct package.json file
866
-  ✔ should return the component info
867
-  when getting the .env file
868
-  ✔ should respond without an error
869
-  ✔ should return the component info
870
-  when getting a static file url
871
-  ✔ should be using the static redirector from registry
872
-  when publishing a component
873
-  when component has a not valid name
874
-  ✔ should respond with an error
875
-  when component has a not valid version
876
-  ✔ should respond with an error
877
-  when component has a valid name and version
878
-  when component with same name and version is already in library
879
-  ✔ should respond with an error
880
-  when is in check mode only
881
-  ✔ should not refresh cached components list
882
-  ✔ should not refresh componens details
883
-  ✔ should not publish components
884
-  when component with same name and version is not in library
885
-  ✔ should refresh cached components list
886
-  ✔ should refresh componens details
887
-  ✔ should store the component in the correct directory
888
-  when metadata store is configured
889
-  ✔ should initialise the metadata store before loading caches
890
-  ✔ should pass top-level manageSchema to the metadata adapter
891
-  ✔ should not reconcile from storage by default
892
-  ✔ should reconcile from storage before loading caches when enabled
893
-  ✔ should keep startup reconciliation idempotent
894
-  ✔ should export legacy files after startup cache hydration when enabled
895
-  ✔ should fail startup when the metadata store is down
896
-  ✔ should not export legacy files on publish (export is timer-driven)
897
-  ✔ should export legacy files on the configured interval and stop after close
898
-  ✔ should not reschedule legacy export when closed while an export is running
899
-  when publishing succeeds
900
-  ✔ should reserve, upload, then commit the version
901
-  ✔ should not refresh metadata caches from the store after publish
902
-  when metadata store reports an existing version
903
-  ✔ should return the existing registry duplicate-version error
904
-  when metadata store is down during publish
905
-  ✔ should fail the publish after uploading statics and abort the reservation
906
-  when publishing the same version concurrently
907
-  ✔ should reserve one publish and reject the duplicate before storage upload
908
-  when publishing different versions concurrently
909
-  ✔ should commit both metadata rows
910
-  close()
911
-  ✔ should stop cache polling before closing the metadata store
912
-  ✔ should resolve when the metadata store has no close hook
913
-  when refreshing details is slow
914
-  ✔ should resolve publish before details refresh finishes
915
-  when on local configuration
916
-  when getting the list of available components
917
-  ✔ should respond without an error
918
-  ✔ should list the components
919
-  when trying to get a not valid component
920
-  when the component does not exist
921
-  ✔ should respond with a proper error
922
-  when the component exists but version does not
923
-  ✔ should respond with a proper error
924
-  when getting an existing component
925
-  ✔ should respond without an error
926
-  ✔ should return the component info
927
-  when getting a static file url
928
-  ✔ should be using the static redirector from registry
929
-  when trying to publish a component
930
-  ✔ should respond with an error
931
-
932
-  registry : domain : require-wrapper
933
-  when using the require wrapper in a clear context
934
-  when requiring a dependency
935
-  ✔ should correctly make the dependency require-able
936
-  when requiring an unrecognised dependency
937
-  ✔ should correctly throw an error
938
-  when requiring a core dependency
939
-  ✔ should correctly require and use the dependency
940
-  when requiring a core dependency with node: prefix
941
-  ✔ should correctly require and use the dependency
942
-  when requiring an unvetted core dependency
943
-  ✔ should correctly throw an error
944
-  when requiring a dependency with a relative path
945
-  ✔ should correctly make the dependency require-able
946
-  when requiring a dependency with a relative path that does not exist
947
-  ✔ should correctly throw an error
948
-  when try-require fails with absolute path but succeeds with package name
949
-  ✔ should fall back to requiring by package name
950
-  when a core module and npm package share the same name
951
-  ✔ should prefer the core module
952
-
953
-  registry : domain : sanitiser
954
-  when sanitising component's request parameters
955
-  when component has boolean parameter
956
-  ✔ should convert string to boolean when true
957
-  ✔ should convert string to boolean when true
958
-  when component has string parameter
959
-  ✔ should convert null to empty
960
-  when component has number parameter
961
-  ✔ should convert string to number
962
-  when component have not defined optional parameter
963
-  ✔ should keep the parameter as it is
964
-
965
-  registry : domain : server-adapter
966
-  when given an adapter factory
967
-  ✔ should return the created adapter
968
-  when given an adapter instance
969
-  ✔ should return the adapter untouched
970
-  when the factory returns an invalid adapter
971
-  ✔ should throw
972
-
973
-  registry : domain : adapter
974
-  when is not a legacy adapter
975
-  ✔ returns the same adapter
976
-  when is a legacy adapter
977
-  ✔ returns a universalified adapter
978
-  when is an official adapter
979
-  ✔ Shows a deprecation warning asking to upgrade
980
-  when is not an official adapter
981
-  ✔ Shows a deprecation warning about callbacks
982
-
983
-  registry : domain : url-builder
984
-  when building component url
985
-  when building component with just component name
986
-  ✔ should be baseUrl/componentName
987
-  when building component with version
988
-  ✔ should be baseUrl/componentName/version
989
-  when building component with query string parameters
990
-  when building component with number parameter
991
-  ✔ should be baseUrl/componentName/version/?param=123
992
-  when building component with url parameter
993
-  ✔ should be baseUrl/componentName/version/?param=encodedUrl
994
-  when building component preview url
995
-  when building url with just component name
996
-  ✔ should be baseUrl/componentName
997
-  when building url with version
998
-  ✔ should be baseUrl/componentName/version
999
-  when building url with query string parameters
1000
-  when building component with number parameter
1001
-  ✔ should be baseUrl/componentName/version/?param=123
1002
-  when building component with url parameter
1003
-  ✔ should be baseUrl/componentName/version/?param=encodedUrl
1004
-
1005
-  registry : domain : validator
1006
-  when validating registry configuration
1007
-  when configuration null
1008
-  ✔ should not be valid
1009
-  when configuration empty
1010
-  ✔ should not be valid
1011
-  prefix
1012
-  when prefix does not start with /
1013
-  ✔ should not be valid
1014
-  when prefix does not end with /
1015
-  ✔ should not be valid
1016
-  publishAuth
1017
-  when not specified
1018
-  ✔ should be valid
1019
-  when specified and not supported
1020
-  ✔ should not be valid
1021
-  when specified and basic
1022
-  when username and password specified
1023
-  ✔ should be valid
1024
-  when multiple logins specified
1025
-  when all logins have username and password
1026
-  ✔ should be valid
1027
-  when some logins are missing username or password
1028
-  ✔ should not be valid
1029
-  when logins array is empty
1030
-  ✔ should not be valid
1031
-  when username and password not specified
1032
-  ✔ should not be valid
1033
-  dependencies
1034
-  when not specified
1035
-  ✔ should be valid
1036
-  when specified
1037
-  when it is an array
1038
-  ✔ should be valid
1039
-  when it is not an array
1040
-  ✔ should not be valid
1041
-  s3
1042
-  when local=true
1043
-  ✔ should be valid
1044
-  when not in local mode
1045
-  when s3 settings empty
1046
-  ✔ should not be valid
1047
-  when s3 setting is missing bucket
1048
-  ✔ should not be valid
1049
-  when s3 setting is missing key
1050
-  ✔ should not be valid
1051
-  when s3 setting is missing region
1052
-  ✔ should not be valid
1053
-  when s3 setting is missing secret
1054
-  ✔ should not be valid
1055
-  when s3 setting do not use key/secret - EC2 IAM Role use case
1056
-  ✔ should be valid
1057
-  when s3 setting contains all properties
1058
-  ✔ should be valid
1059
-  routes
1060
-  when not specified
1061
-  ✔ should be valid
1062
-  when specified
1063
-  when not an array
1064
-  ✔ should not be valid
1065
-  when route does not contain route
1066
-  ✔ should not be valid
1067
-  when route does not contain handler
1068
-  ✔ should not be valid
1069
-  when route does not contain method
1070
-  ✔ should not be valid
1071
-  when route contains handler that is not a function or a string
1072
-  ✔ should not be valid
1073
-  when route overrides prefix namespace
1074
-  ✔ should not be valid
1075
-  metadata
1076
-  ✔ should pass top-level manageSchema to the metadata adapter
1077
-  ✔ should reject invalid export legacy files intervals
1078
-  ✔ should reject export legacy files interval without export legacy files enabled
1079
-  ✔ should accept export legacy files interval when export legacy files is enabled
1080
-  when adapter is missing
1081
-  ✔ should not be valid
1082
-  when adapter configuration is invalid
1083
-  ✔ should not be valid
1084
-  when adapter configuration is valid
1085
-  ✔ should be valid
1086
-  customHeadersToSkipOnWeakVersion
1087
-  when customHeadersToSkipOnWeakVersion is not an array
1088
-  ✔ should not be valid
1089
-  when customHeadersToSkipOnWeakVersion is an array but contains non-string elements
1090
-  ✔ should not be valid
1091
-  when customHeadersToSkipOnWeakVersion is a non-empty array of strings
1092
-  ✔ should be valid
1093
-  when validating component request by parameter
1094
-  when component have not parameters
1095
-  ✔ should be valid
1096
-  when component have not mandatory parameters
1097
-  ✔ should be valid when non mandatory parameters not provided
1098
-  ✔ should be valid when non mandatory parameters provided in a valid format
1099
-  ✔ should be not valid when non mandatory parameters provided in a non valid format
1100
-  when component have mandatory parameters
1101
-  ✔ should not be valid when mandatory parameter not provided
1102
-  when mandatory string parameter provided
1103
-  ✔ should be valid when parameter in a valid form
1104
-  ✔ should not be valid when parameter in a non valid form
1105
-  ✔ should be valid when parameter is an empty string
1106
-  when non mandatory number provided
1107
-  ✔ should not be valid when provided in a non valid form
1108
-  ✔ should be valid when 0
1109
-  when non mandatory boolean provided
1110
-  ✔ should not be valid when provided in a non valid form
1111
-  when mandatory number parameter provided
1112
-  ✔ should be valid when parameter in a valid form
1113
-  ✔ should not be valid when parameter in a non valid form
1114
-  ✔ should not be valid when parameter is null
1115
-  when mandatory boolean parameter provided
1116
-  ✔ should be valid when parameter in a valid form
1117
-  ✔ should not be valid when parameter in a non valid form
1118
-  ✔ should not be valid when parameter is null
1119
-  ✔ should not be valid when parameter is undefined
1120
-  ✔ should not be valid when parameter not provided
1121
-  when component parameters have enum constraints
1122
-  when string parameter has enum constraint
1123
-  ✔ should be valid when parameter value is in enum
1124
-  ✔ should be valid when parameter value is another valid enum value
1125
-  ✔ should not be valid when parameter value is not in enum
1126
-  ✔ should not be valid when parameter value is case sensitive
1127
-  when number parameter has enum constraint
1128
-  ✔ should be valid when parameter value is in enum
1129
-  ✔ should be valid when parameter value is another valid enum value
1130
-  ✔ should not be valid when parameter value is not in enum
1131
-  ✔ should not be valid when parameter value is zero but not in enum
1132
-  when boolean parameter has enum constraint
1133
-  ✔ should be valid when parameter value is in enum
1134
-  ✔ should not be valid when parameter value is not in enum
1135
-  when parameter has both type and enum validation
1136
-  ✔ should not be valid when parameter has wrong type
1137
-  ✔ should not be valid when parameter has correct type but wrong enum value
1138
-  when multiple parameters have enum constraints
1139
-  ✔ should be valid when all parameters have valid enum values
1140
-  ✔ should not be valid when one parameter has invalid enum value
1141
-  ✔ should not be valid when multiple parameters have invalid enum values
1142
-  when parameter has empty enum array
1143
-  ✔ should not be valid when any value is provided
1144
-  when parameter has single value enum
1145
-  ✔ should be valid when parameter matches the single enum value
1146
-  ✔ should not be valid when parameter does not match the single enum value
1147
-  when validating component name for new candidate
1148
-  when name has spaces
1149
-  ✔ should not be valid
1150
-  when name has not allowed characters
1151
-  ✔ should not be valid
1152
-  when name has alphanumeric characters, _ or -
1153
-  ✔ should be valid
1154
-  when name is reserved
1155
-  ✔ should not be valid
1156
-  when validating component version for new candidate
1157
-  when version already exists
1158
-  ✔ should not be valid
1159
-  when version does not exist
1160
-  ✔ should be valid
1161
-  when validating component package for new candidate
1162
-  when package not valid
1163
-  ✔ should not be valid when uploaded files is empty
1164
-  ✔ should not be valid when uploaded package consists of multiple files
1165
-  ✔ should not be valid when file has not the proper file extension
1166
-  ✔ should not be valid when file has been truncated
1167
-  ✔ should not be valid when file has wrong mimetype
1168
-  when custom validation provided
1169
-  when package.json does not contain mandatory fields
1170
-  ✔ should not be valid
1171
-  ✔ should return the error
1172
-  when package.json contains mandatory fields
1173
-  ✔ should be valid
1174
-  when package is valid
1175
-  ✔ should be valid with mimetype application/octet-stream
1176
-  ✔ should be valid with mimetype application/gzip
1177
-  when validating component plugin requirements
1178
-  when component does not require any plugin
1179
-  ✔ should be valid
1180
-  when component requires plugin
1181
-  when registry does not support plugin
1182
-  ✔ should not be valid
1183
-  ✔ should list missing dependencies
1184
-  when registry supports plugin
1185
-  ✔ should be valid
1186
-  when validating CLI OC version in request headers
1187
-  when user-agent header is not specified
1188
-  ✔ should be invalid
1189
-  ✔ should suggest correct version of CLI
1190
-  when user-agent header doesn't have correct format
1191
-  ✔ should be invalid
1192
-  ✔ should suggest correct version of CLI
1193
-  when OC CLI version in user-agent header is lower than Registry version
1194
-  ✔ should be invalid
1195
-  ✔ should suggest correct version of CLI
1196
-  when OC CLI version in user-agent header is equal to Registry version (same major.minor)
1197
-  ✔ should be valid
1198
-  ✔ should not return an error
1199
-  when OC CLI version in user-agent header is higher than Registry version
1200
-  ✔ should be valid
1201
-  ✔ should not return an error
1202
-  when OC CLI version has different patch version but same major.minor
1203
-  ✔ should be valid
1204
-  ✔ should not return an error
1205
-  when validating node engine version in request headers
1206
-  when user-agent header is not specified
1207
-  ✔ should be invalid
1208
-  ✔ should suggest correct version of node engine
1209
-  when user-agent header doesn't have correct format
1210
-  ✔ should be invalid
1211
-  ✔ should suggest correct version of node engine
1212
-  when node version in user-agent header is lower than Registry version of node
1213
-  ✔ should be invalid
1214
-  ✔ should suggest correct version of node engine
1215
-  when node version in user-agent header is equal to Registry version of node
1216
-  ✔ should be valid
1217
-  ✔ should not return an error
1218
-  when node version in user-agent header is higher than Registry version of node
1219
-  ✔ should be valid
1220
-  ✔ should not return an error
1221
-
1222
-  registry : domain : version-handler
1223
-  when getting component
1224
-  when versions not available
1225
-  ✔ should return an undefined when a version is specified
1226
-  ✔ should return an undefined when a version is not specified
1227
-  when versions available
1228
-  ✔ should return the latest when a version is not specified
1229
-  ✔ should return undefined when not valid version specified
1230
-  ✔ should return the latest when latest version specified
1231
-  ✔ should return the latest minor+patch of a version when minor omitted
1232
-  ✔ should return the latest path for minor when patch omitted
1233
-  ✔ should return the latest patch of a version when ~ used on patch level
1234
-  ✔ should return the latest patch version when ~ used on minor level
1235
-  ✔ should return the latest patch of a version when X used on patch
1236
-  ✔ should return the latest patch of a version when X used on minor
1237
-  when only pre release versions available
1238
-  ✔ should return the latest when a version is not specified
1239
-  ✔ should return undefined when not valid version specified
1240
-  ✔ should return the latest when latest version specified
1241
-  ✔ should return the version specified
1242
-  when mix of release and pre-release versions available
1243
-  ✔ should return the latest release version when a version is not specified
1244
-  ✔ should return the latest when latest version specified
1245
-  ✔ should return the version specified
1246
-  when publishing component
1247
-  when version already exists
1248
-  ✔ shouldn't be valid
1249
-  when version is available
1250
-  ✔ should be valid when major than latest
1251
-  ✔ should be valid when major than latest minor of previous major
1252
-  ✔ should be valid when major than latest patch of previous minor
1253
-  ✔ should be valid when minor than an existing patch but not existing
1254
-
1255
-  registry : routes : component
1256
-  when getting a component with server.js execution timeout
1257
-  ✔ should return 500 status code
1258
-  ✔ should respond with error message
1259
-  ✔ should return component's name and request version
1260
-  when getting a component with a server.js that returns undefined data
1261
-  ✔ should return 500 status code
1262
-  ✔ should respond with error message for undefined data
1263
-  ✔ should return component's name and request version
1264
-  when getting a component with server.js execution errors
1265
-  ✔ should return 500 status code
1266
-  ✔ should respond with error message including missing plugin
1267
-  ✔ should return component's name and request version
1268
-  when getting a component with server.js asynchronous execution errors
1269
-  when has error that gets fired on first execution
1270
-  ✔ should return 500 status code
1271
-  ✔ should respond with error message for component execution error
1272
-  ✔ should return component's name and request version
1273
-  when has error that gets fired on following executions
1274
-  ✔ should return 200 status code for successful request
1275
-  ✔ should return 500 status code when error happens
1276
-  ✔ should respond without error for successful request
1277
-  ✔ should respond with error message for component execution error
1278
-  ✔ should return component's name and request version for both requests
1279
-  when getting a component that implements a plugin
1280
-  when plugin not declared in package.json
1281
- (node:98496) [DEP0097] DeprecationWarning: Using a domain property in MakeCallback is deprecated. Use the async_context variant of MakeCallback or the AsyncResource class instead. (Triggered by calling processImmediate on process.)
1282
-  ✔ should return 500 status code
1283
-  ✔ should respond with GENERIC_ERROR error code
1284
-  ✔ should respond with error message including missing plugin
1285
-  ✔ should return component's name and request version
1286
-  when plugin declared in package.json
1287
-  when registry implements plugin
1288
-  ✔ should return 200 status code
1289
-  ✔ should use plugin inside compiledView
1290
-  ✔ should return component's name and request version
1291
-  when registry does not implement plugin
1292
-  ✔ should return 501 status code
1293
-  ✔ should respond with PLUGIN_MISSING_FROM_REGISTRY error code
1294
-  ✔ should respond with error message including missing plugin
1295
-  ✔ should return component's name and request version
1296
-  when getting a component that requires a npm module
1297
-  when registry implements dependency
1298
-  ✔ should return 200 status code
1299
-  ✔ should use plugin inside compiledView
1300
-  ✔ should return component's name and request version
1301
-  when registry does not implement dependency
1302
-  ✔ should return 501 status code
1303
-  ✔ should respond with DEPENDENCY_MISSING_FROM_REGISTRY error code
1304
-  ✔ should respond with error message including missing dependency
1305
-  ✔ should return component's name and request version
1306
-  when getting a component with server.js that sets custom headers with empty customHeadersToSkipOnWeakVersion
1307
-  ✔ should return 200 status code
1308
-  ✔ should set response headers
1309
-  ✔ should return component's name and request version
1310
-  when getting a component with server.js that sets custom headers with non-empty customHeadersToSkipOnWeakVersion
1311
-  ✔ should return 200 status code
1312
-  ✔ should not set response headers
1313
-  ✔ should return component's name and request version
1314
-  when getting a simple component with server.js after headers component no custom headers should be set
1315
-  ✔ should return 200 status code for the first component
1316
-  ✔ should return "response-headers-component" name for the first component's name and request version
1317
-  ✔ should set response headers for the first component
1318
-  ✔ should return 200 status code for the second component
1319
-  ✔ should return "simple-component" name for the second component's name and request version
1320
-  ✔ should not set custom response for the second component
1321
-  when getting a component info for a component that sets custom headers
1322
-  ✔ should return 200 status code
1323
-  ✔ should return no custom headers
1324
-  ✔ should return component's name and request version
1325
-  ✔ should not return rendered HTML
1326
-
1327
-  registry : routes : components
1328
-  when making valid request for two components
1329
-  ✔ should return 200 status code
1330
-  ✔ should return a response containing both components
1331
-  ✔ should return a response containing components in the correct order
1332
-  ✔ should return a response with error code and description for the first component
1333
-  ✔ should return a response with rendered html for second component
1334
-  ✔ should include 500 status code for first component
1335
-  ✔ should include 200 status code for second component
1336
-  ✔ should return name and request version for both components
1337
-  when making request for 0 components
1338
-  ✔ should return 200 status code
1339
-  ✔ should return a response containing empty array
1340
-  when making valid info request for two components
1341
-  ✔ should return 200 status code
1342
-  ✔ should return a response containing both components
1343
-  ✔ should return a response containing components in the correct order
1344
-  when making info request for 0 components
1345
-  ✔ should return 200 status code
1346
-  ✔ should return a response containing empty array
1347
-  when making not valid request
1348
-  when not providing components property
1349
-  ✔ should return 400 status code
1350
-  ✔ should return error details
1351
-  when components property is not an array
1352
-  ✔ should return 400 status code
1353
-  ✔ should return error details
1354
-  when component does not have name property
1355
-  ✔ should return 400 status code
1356
-  ✔ should return error details
1357
-  when components do not have name property
1358
-  ✔ should return 400 status code
1359
-  ✔ should return error details
1360
-  when getting a component that has custom parameters
1361
-  ✔ should return a 200 response
1362
-  when getting a component that has missing required parameters
1363
-  ✔ should return 400 status code
1364
-  when making valid info request for a component action
1365
-  ✔ should return a 200 response
1366
-
1367
-  registry : routes : plugins
1368
-  when is not discoverable
1369
-  ✔ should return 401 status code
1370
-  when is discoverable
1371
-  ✔ should return the list of dependencies
1372
-
1373
-  registry : routes : helpers : apply-default-values
1374
-  when component deesn't have optional parameters
1375
-  ✔ should return requestParameters
1376
-  when component has optional parameters
1377
-  when default value of parameter is not specified
1378
-  when request doesn't specify values of optional parameters
1379
-  ✔ should return requestParameters
1380
-  when default value of parameter is specified
1381
-  when request specify values of optional parameters
1382
-  ✔ should return requestParameters
1383
-  when request specify values of some optional parameters
1384
-  ✔ should return requestParameters
1385
-  when request doesn't specify values of optional parameters
1386
-  when string parameter is undefined
1387
-  ✔ should return requestParameters with default values of optional parameters
1388
-  when string parameter is null
1389
-  ✔ should return requestParameters with default values of optional parameters
1390
-
1391
-  registry : routes : helpers : get-available-dependencies
1392
-  happy path
1393
-  ✔ should map to structured view-model
1394
-
1395
-  registry : routes : helpers : get-component-fallback
1396
-  ✔ should not forward accept-encoding header when fetching from fallback registry
1397
-
1398
-  registry : routes : helpers : get-component
1399
-  when the component has an env file
1400
-  ✔ should put the env data as part of the context, available to the server
1401
-  when getting a component with success
1402
-  ✔ should fire a component-retrieved event
1403
-  when getting a component with failure
1404
-  ✔ should fire a data-provider-error event
1405
-  ✔ should fire a component-retrieved event
1406
-  when the component sends a custom status code
1407
-  ✔ should return that status code to the client
1408
-  when rendering a component with a legacy template
1409
-  when oc-client requests an unrendered component and it doesn't provide templates header
1410
-  ✔ should return the unrendered version
1411
-  when oc-client requests an unrendered component and it supports the correct template
1412
-  ✔ should return the unrendered version
1413
-  when rendering a component with a non legacy template
1414
-  when the registry supports the template
1415
-  when oc-client requests an unrendered component and the client doesn't support it
1416
-  ✔ should return the rendered version
1417
-  when oc-client requests an unrendered component and the client supports the correct template
1418
-  ✔ should return the unrendered version
1419
-  when the registry doesn't support the template
1420
-  when oc-client requests an unrendered component and the client doesn't support it
1421
-  ✔ should return an error
1422
-  when oc-client requests an unrendered component and the client supports the correct template
1423
-  ✔ should return an error
1424
-
1425
-  registry : routes : helpers : get-components-history
1426
-  when components details are provided
1427
-  composing the single history object
1428
-  ✔ should return the publish date of a component
1429
-  ✔ should return the version of a component
1430
-  ✔ should return the component name
1431
-  sorting the entries by date
1432
-  ✔ should return the publish date of a component
1433
-
1434
-  registry : routes : helpers : is-url-discoverable
1435
-  when url responds with application/json
1436
-  ✔ should not be discoverable
1437
-  when url responds with text/html
1438
-  ✔ should be discoverable
1439
-
1440
-  registry : routes : plugins
1441
-  when is not discoverable
1442
-  ✔ should return 401 status code
1443
-  when is discoverable
1444
-  ✔ should return the list of plugins
1445
-
1446
-  registry : routes : publish
1447
-  when publish finishes
1448
-  ✔ should remove only the uploaded package and extracted package folder
1449
-
1450
-  registry : routes : validate
1451
-  when packageJson is missing in body
1452
-  ✔ should return 400 status
1453
-  ✔ should return error message
1454
-  when component name and version are missing
1455
-  ✔ should return 400 status
1456
-  ✔ should return error message about missing name and version
1457
-  when component name is invalid
1458
-  ✔ should return 409 status
1459
-  ✔ should return error code and message
1460
-  when component version is invalid
1461
-  ✔ should return 409 status
1462
-  ✔ should return error code and message
1463
-  when validation is successful
1464
-  ✔ should return 200 status
1465
-  ✔ should return success message
1466
-  when using URL params for component name and version
1467
-  ✔ should return 200 status
1468
-  ✔ should return success message
1469
-
1470
-  registry
1471
-  when instanciated
1472
-  when options are not valid
1473
-  ✔ should throw an error
1474
-  when options are valid
1475
-  ✔ should instantiate the HTTP server adapter
1476
-  ✔ should bind the middleware
1477
-  ✔ should instanciate the repository
1478
-  when starting it
1479
-  when plugins initialiser fails
1480
-  ✔ should fail with error
1481
-  when plugins initialiser succeeds
1482
-  when repository initialisation fails
1483
-  ✔ should fail with error
1484
-  when repository initialisation succeeds
1485
-  when app fails to start
1486
-  ✔ should fail with error
1487
-  when app starts
1488
-  when http listener errors
1489
-  ✔ should fail with error
1490
-  when http listener succeeds
1491
-  ✔ should not return error
1492
-  ✔ should return the server instance
1493
-  ✔ should emit a start event
1494
-  when http listener emits an error before the listener to start
1495
-  ✔ should return error
1496
-  ✔ should emit an error event
1497
-  when closing it
1498
-  ✔ should close the repository when the server is not listening
1499
-  ✔ should close the server then the repository when listening
1500
-  ✔ should still call the repository close when the server close errors
1501
-
1502
-  resources : settings
1503
-  files to watch ignore regex
1504
-  when a legitimate file changes
1505
-  ✔ should not ignore it
1506
-  when a file in a github.io repo changes
1507
-  ✔ should not ignore it
1508
-  when something in the .git folder changes
1509
-  ✔ should ignore it
1510
-  when something in the .idea folder changes
1511
-  ✔ should ignore it
1512
-  when node_modules changes
1513
-  ✔ should ignore it
1514
-
1515
-  utils : dateStringify
1516
-  when the date is provided
1517
-  ✔ should return the correct stringified date
1518
-  when the provided data is not valid
1519
-  ✔ should return empty string
1520
-
1521
-  utils : npm-utils
1522
-  init()
1523
-  when invoked for path/to/component with silent=undefined
1524
-  ✔ should spawn the process with correct parameters
1525
-  ✔ should return no error
1526
-  ✔ should correctly setup on error and on close listeners
1527
-  when invoked for path/to/component with silent=true
1528
-  ✔ should spawn the process with correct parameters
1529
-  ✔ should return no error
1530
-  ✔ should correctly setup on error and on close listeners
1531
-  installDependency()
1532
-  when invoked for installing oc-template-jade-compiler
1533
-  ✔ should spawn the process with correct parameters
1534
-  ✔ should return no error
1535
-  ✔ should return the installation path
1536
-  ✔ should correctly setup on error and on close listeners
1537
-  when invoked for installing lodash
1538
-  ✔ should spawn the process with correct parameters
1539
-  ✔ should return no error
1540
-  ✔ should return the installation path
1541
-  ✔ should correctly setup on error and on close listeners
1542
-  when invoked for installing underscore
1543
-  ✔ should spawn the process with correct parameters
1544
-  ✔ should return no error
1545
-  ✔ should return the installation path
1546
-  ✔ should correctly setup on error and on close listeners
1547
-  when invoked for installing oc-client@~1.2.3
1548
-  ✔ should spawn the process with correct parameters
1549
-  ✔ should return no error
1550
-  ✔ should return the installation path
1551
-  ✔ should correctly setup on error and on close listeners
1552
-  installDependencies()
1553
-  when invoked for installing [oc-template-jade-compiler, lodash]
1554
-  ✔ should spawn the process with correct parameters
1555
-  ✔ should return no error
1556
-  ✔ should return the installation path
1557
-  ✔ should correctly setup on error and on close listeners
1558
-  when invoked for installing [moment, lodash]
1559
-  ✔ should spawn the process with correct parameters
1560
-  ✔ should return no error
1561
-  ✔ should return the installation path
1562
-  ✔ should correctly setup on error and on close listeners
1563
-  when invoked for installing [underscore, oc-client]
1564
-  ✔ should spawn the process with correct parameters
1565
-  ✔ should return no error
1566
-  ✔ should return the installation path
1567
-  ✔ should correctly setup on error and on close listeners
1568
-  when invoked for installing [oc-client@~1.2.3, oc-template-react-compiler]
1569
-  ✔ should spawn the process with correct parameters
1570
-  ✔ should return no error
1571
-  ✔ should return the installation path
1572
-  ✔ should correctly setup on error and on close listeners
1573
-
1574
-  utils : stripVersion
1575
-  when a non scoped dependency is provided
1576
-  when a version is included
1577
-  ✔ should return the dependency without the version
1578
-  when a version is not included
1579
-  ✔ should return the unmodified dependency
1580
-  when a scoped dependency is provided
1581
-  when a version is included
1582
-  ✔ should return the dependency without the version
1583
-  when a version is not included
1584
-  ✔ should return the unmodified dependency
1585
-
1586
-  registry (ui interface)
1587
-  GET / with Accept: text/html
1588
-  ✔ should not error
1589
-  ✔ should respond with html result
1590
-  GET /oc-client/~info with Accept: text/html
1591
-  ✔ should not error
1592
-  ✔ should respond with html result
1593
-  GET /welcome-with-optional-parameters/~info with Accept: text/html
1594
-  ✔ should not error
1595
-  ✔ should respond with html result
1596
-  ✔ should include parameter input fields
1597
-  ✔ should include parameter update JavaScript
1598
-
1599
-  registry
1600
-  when initialised with invalid configuration
1601
-  ✔ should throw an error
1602
-  GET /hello-world-custom-headers
1603
-  with the default configuration (no customHeadersToSkipOnWeakVersion defined) and strong version 1.0.0
1604
-  ✔ should return the component with custom headers
1605
-  with the default configuration (no customHeadersToSkipOnWeakVersion defined) and weak version 1.x.x
1606
-  ✔ should return the component with custom headers
1607
-  with a custom configuration with customHeadersToSkipOnWeakVersion defined
1608
-  when strong version is requested 1.0.0
1609
-  ✔ should return the component with the custom headers
1610
-  when weak version is requested 1.x.x
1611
-  ✔ should skip Cache-Control header
1612
-  GET /hello-world-custom-cookies
1613
-  with the default configuration and strong version 1.0.0
1614
-  ✔ should return the component and set cookies
1615
-  POST /hello-world-custom-headers
1616
-  with the default configuration (no customHeadersToSkipOnWeakVersion defined) and strong version 1.0.0
1617
-  ✔ should set HTTP custom headers
1618
-  ✔ should return the component with custom headers
1619
-  request with two components
1620
-  ✔ should not set HTTP custom headers
1621
-  with the default configuration (no customHeadersToSkipOnWeakVersion defined) and weak version 1.x.x
1622
-  ✔ should set HTTP custom headers
1623
-  ✔ should return the component with custom headers in the response body
1624
-  with a custom configuration with customHeadersToSkipOnWeakVersion defined
1625
-  when strong version is requested 1.0.0
1626
-  ✔ should set HTTP custom headers
1627
-  ✔ should return the component with the custom headers
1628
-  when weak version is requested 1.x.x
1629
-  ✔ should have HTTP custom headers
1630
-  ✔ should skip Cache-Control header
1631
-  POST /hello-world-custom-cookies
1632
-  with the default configuration and strong version 1.0.0
1633
-  ✔ should set HTTP cookies
1634
-  ✔ should return the component and keep headers in body the same
1635
-  GET /
1636
-  ✔ should respond with the correct href
1637
-  ✔ should list the components
1638
-  POST / (with circular-json)
1639
-  ✔ should respond with 500 status code
1640
-  ✔ should respond with rendering error
1641
-  GET /circular-json-error
1642
-  ✔ should respond with 500 status code
1643
-  ✔ should respond with rendering error
1644
-  GET /handlebars3-component
1645
-  ✔ should respond with 500 status code
1646
-  ✔ should respond with error for unsupported handlebars version
1647
-  GET /jade-filters
1648
-  ✔ should respond with 200 status code
1649
-  GET /hello-world
1650
-  when Accept header not specified
1651
-  ✔ should respond with the correct href
1652
-  ✔ should respond with requested version
1653
-  ✔ should respond with resolved version
1654
-  ✔ should respond with component name
1655
-  ✔ should respond with the rendered template
1656
-  ✔ should respond with render type = rendered
1657
-  when Accept header set to application/vnd.oc.unrendered+json
1658
-  ✔ should respond with the correct href
1659
-  ✔ should respond with requested version
1660
-  ✔ should respond with resolved version
1661
-  ✔ should respond with component name
1662
-  ✔ should respond with the un-rendered template
1663
-  ✔ should respond with proper render type
1664
-  GET /container-with-nested
1665
-  ✔ should respond with the correct href
1666
-  ✔ should respond with the rendered template including the nested rendered component
1667
-  ✔ should respond with proper render type
1668
-  GET /container-with-multiple-nested
1669
-  ✔ should respond with the correct href
1670
-  ✔ should respond with the rendered template including the nested rendered component
1671
-  ✔ should respond with proper render type
1672
-  GET /no-containers
1673
-  when Accept header not specified
1674
-  ✔ should respond with the correct href
1675
-  ✔ should respond with the rendered template without the outer container and without render info script
1676
-  ✔ should respond with proper render type
1677
-  GET /language
1678
-  when Accept-Language: en-US
1679
-  ✔ should respond with correct href
1680
-  ✔ should contain english language
1681
-  when Accept-Language: ja-JP
1682
-  ✔ should respond with correct href
1683
-  ✔ should contain japanese language
1684
-  when Accept-Language: ja-JP but __ocAcceptLanguage overrides with en-US (client-side failover)
1685
-  ✔ should respond with correct href
1686
-  ✔ should contain japanese language
1687
-  GET /lodash-component
1688
-  ✔ should respond with the correct href
1689
-  ✔ should respond correctly after using lodash server dependency
1690
-  GET /empty
1691
-  rendered
1692
-  ✔ should respond with the correct href
1693
-  ✔ should respond with an empty response
1694
-  unrendered
1695
-  ✔ should respond with the correct href
1696
-  ✔ should respond with a minimal empty view-model
1697
-  POST /
1698
-  when body is malformed
1699
-  ✔ should respond with 400 status code
1700
-  ✔ should respond with error
1701
-  when body contains multiple components
1702
-  when Accept header not specified
1703
-  ✔ should respond with two 200 status codes
1704
-  ✔ should respond with two rendered components
1705
-  when omitHref=true
1706
-  when getting rendered components
1707
-  ✔ should respond without href parameter
1708
-  when getting unrendered components
1709
-  ✔ should respond without href parameter
1710
-  when Accept header set to application/vnd.oc.unrendered+json
1711
-  ✔ should respond with two unrendered components
1712
-  when components require params
1713
-  when each component requires different params
1714
-  ✔ should render components with expected parameters
1715
-  when components require same parameters
1716
-  ✔ should render components with expected parameters
1717
-  when components have some common parameters and some different
1718
-  ✔ should render components with expected parameters
1719
-  when components have global parameters with local overrides
1720
-  ✔ should render components with expected parameters
1721
-  when components accept optional parameters
1722
-  ✔ should render first component with provided parameters
1723
-  ✔ should render second and third components with default value of nick
1724
-  ✔ should render fourth component without value of lastName
1725
-  GET /:componentName/:componentVersion/static/*splat (local-mode static route)
1726
-  when requesting an existing packaged file
1727
-  ✔ should respond with 200
1728
-  ✔ should respond with the packaged file contents
1729
-  when requesting a missing file
1730
-  ✔ should respond with 404
1731
-
1732
-  registry
1733
-  when fallbackRegistryUrl is specified
1734
-  GET /welcome
1735
-  ✔ should respond with the local registry url
1736
-  ✔ should respond the `Hello world!` html
1737
-  GET /fallback-hello-world
1738
-  ✔ should respond with the fallback registry url
1739
-  ✔ should respond the `Hello world!` html
1740
-  GET /fallback-hello-world/~info
1741
-  ✔ should respond with requested component
1742
-  ✔ should respond with components parameters
1743
-  GET /fallback-hello-world/~preview
1744
-  ✔ should respond with requested component
1745
-  ✔ should respond with components parameters
1746
-
1747
-
1748
-   937 passing (12s)
1749
-
1750
- ⠙
1
+
2
+ > oc@0.50.61 test
3
+ > node tasks/mochaTest.js
4
+
5
+ compiling component /Users/Ricardo.Agullo/Work/opencomponents/oc/packages/oc/test/fixtures/components/circular-json-error
6
+ compiling component /Users/Ricardo.Agullo/Work/opencomponents/oc/packages/oc/test/fixtures/components/container-with-multiple-nested
7
+ compiling component /Users/Ricardo.Agullo/Work/opencomponents/oc/packages/oc/test/fixtures/components/container-with-nested
8
+ compiling component /Users/Ricardo.Agullo/Work/opencomponents/oc/packages/oc/test/fixtures/components/empty
9
+ compiling component /Users/Ricardo.Agullo/Work/opencomponents/oc/packages/oc/test/fixtures/components/hello-world
10
+ compiling component /Users/Ricardo.Agullo/Work/opencomponents/oc/packages/oc/test/fixtures/components/hello-world-custom-cookies
11
+ compiling component /Users/Ricardo.Agullo/Work/opencomponents/oc/packages/oc/test/fixtures/components/hello-world-custom-headers
12
+ compiling component /Users/Ricardo.Agullo/Work/opencomponents/oc/packages/oc/test/fixtures/components/jade-filters
13
+ compiling component /Users/Ricardo.Agullo/Work/opencomponents/oc/packages/oc/test/fixtures/components/language
14
+ compiling component /Users/Ricardo.Agullo/Work/opencomponents/oc/packages/oc/test/fixtures/components/lodash-component
15
+ compiling component /Users/Ricardo.Agullo/Work/opencomponents/oc/packages/oc/test/fixtures/components/no-containers
16
+ compiling component /Users/Ricardo.Agullo/Work/opencomponents/oc/packages/oc/test/fixtures/components/welcome
17
+ compiling component /Users/Ricardo.Agullo/Work/opencomponents/oc/packages/oc/test/fixtures/components/welcome-with-optional-parameters
18
+ Test components packaged 👍
19
+
20
+
21
+ utils : put
22
+ when the registry edge resets streamed uploads over HTTP/2
23
+ (node:52796) Warning: Setting the NODE_TLS_REJECT_UNAUTHORIZED environment variable to '0' makes TLS connections and HTTPS requests insecure by disabling certificate verification.
24
+ (Use `node --trace-warnings ...` to show where the warning was created)
25
+ uploads successfully by falling back to HTTP/1.1
26
+
27
+ The targz dependency
28
+ when compressing a folder with targz
29
+ should create the file
30
+ when decompressing the created file
31
+ should throw no error
32
+ should contain the files
33
+
34
+ cli : domain : clean
35
+ when fetching the list of folders to clean
36
+ happy path
37
+ should return no error
38
+ should return the list
39
+ getComponentsByDir error
40
+ should return error
41
+ when removing the folders to clean
42
+ happy path
43
+ should return no error
44
+ should remove all the folders
45
+ fs.remove error
46
+ should return the error
47
+ should try removing all the folders
48
+
49
+ cli : domain : get-components-by-dir
50
+ when getting components from dir
51
+ should not error
52
+ should get the correct list
53
+ when reading a broken package.json
54
+ should not error
55
+ should get the correct list
56
+ when finds no components
57
+ should not error
58
+ should get an empty list
59
+ when components are filtered
60
+ should not error
61
+ should get an the filtered list
62
+
63
+ cli : domain : get-mocked-plugins
64
+ when setting up mocked plugins
65
+ when componentsDir parameter is undefined
66
+ should use . as default
67
+ when componentsDir parameter is omitted
68
+ should use . as default
69
+ when oc.json is in both root and component folder
70
+ should return plugins from the provided components folder config
71
+ when oc.json is missing
72
+ should return an empty array
73
+ when no plugins are specified
74
+ should return an empty array
75
+ when a static plugin is specified
76
+ should return the static plugin
77
+ should set up the execute method to return the specified value
78
+ when a dynamic plugin with a function signature is specified
79
+ should return the dynamic plugin
80
+ should set up the execute method to run the module
81
+ when a dynamic plugin with an object signature is specified
82
+ should return the dynamic plugin
83
+ should set up the execute method to run the module
84
+ when a dynamic plugin is specified and the referenced file is missing
85
+ should log an error
86
+ should omit the broken plugin from the results
87
+ when a dynamic plugin is specified and the module is not a function
88
+ should log an error
89
+ should omit the broken plugin from the results
90
+
91
+ cli : domain : handle-dependencies : ensure-compiler-is-declared-as-devDependency
92
+ when compiler is declared as devDependency
93
+ should return no error
94
+ should return the compiler dependency
95
+ when compiler is not declared as devDependency
96
+ should return the error
97
+
98
+ cli : domain : handle-dependencies : get-compiler
99
+ when compiler is already installed inside the component's folder
100
+ should try to require it from the component's path
101
+ should return no error
102
+ should not try to install it
103
+ when compiler is not installed inside the component's folder
104
+ when compiler version is specified
105
+ should return no error
106
+ should install it
107
+ when compiler version is not specified
108
+ should return no error
109
+ should install it
110
+ when install fails
111
+ should return the error
112
+
113
+ cli : domain : handle-dependencies - get-missing-dependencies
114
+ When dependencies: {"lodash":"1.2.3","underscore":""} and installed: {"lodash":true,"underscore":false}
115
+ should output ["underscore@latest"]
116
+ should resolve the dependency relative to where the oc cli is running
117
+ When dependencies: {"lodash":"1.2.3","underscore":"4.5.6"} and installed: {"lodash":true,"underscore":false}
118
+ should output ["underscore@4.5.6"]
119
+ should resolve the dependency relative to where the oc cli is running
120
+ When dependencies: {"lodash":"1.2.3","underscore":""} and installed: {"lodash":true,"underscore":true}
121
+ should output []
122
+ should resolve the dependency relative to where the oc cli is running
123
+
124
+ cli : domain : handle-dependencies : install-compiler
125
+ when succeeds
126
+ should run npm install with correct parameters
127
+ should return no error
128
+ should return the compiler
129
+ should log progress
130
+ when install fails
131
+ should return an error
132
+ should log progress
133
+ when install succeeds but validation fails
134
+ should return an error
135
+ should log progress
136
+
137
+ cli : domain : handle-dependencies : install-missing-dependencies
138
+ when there is no missing dependency
139
+ should return no error
140
+ should not install anything
141
+ when there are missing dependencies and install succeeds
142
+ should return no error
143
+ should install the missing dependencies
144
+ should log progress
145
+ when there are missing dependencies and install fails
146
+ should return the error
147
+ should log progress
148
+ when there are missing dependencies and install succeeds but the dependencies are still not requireable
149
+ should return the error
150
+ should log progress
151
+
152
+ cli : domain : handle-dependencies : require-template
153
+ when requiring template
154
+ when module not found
155
+ should try requiring from component folder first
156
+ should try requiring it as absolute as second attempt
157
+ should try requiring it relatively to the oc runtime as third attempt
158
+ should try requiring it relatively to the oc cli as fourth attempt
159
+ should then throw an exeption
160
+ when template is legacy (jade)
161
+ should require the oc-template-jade instead
162
+ should return the template
163
+ when template is legacy (handlebars)
164
+ should require the oc-template-handlebars instead
165
+ should return the template
166
+ when requiring a compiler (oc-template-react)
167
+ should require the oc-template-react-compiler
168
+ should return the template
169
+ when module found in the component's folder
170
+ when the template is valid
171
+ should return the template
172
+ when the template is not valid
173
+ should throw an error
174
+
175
+ cli : domain : handle-dependencies
176
+ happy path
177
+ when packaging
178
+ should return no error
179
+ should return modules plus the node.js core modules
180
+ should return templates
181
+ should log progress
182
+ should make sure compilers are declared as devDependencies
183
+ should fetch the compilers
184
+ should install the dependencies if missing
185
+ when in dev mode
186
+ should not install the dependencies if missing
187
+
188
+ cli : domain : init-template : install-template
189
+ when succeeds
190
+ should spawn the right process
191
+ should validate the template
192
+ should return no error
193
+ should log progress and success
194
+
195
+ cli : domain : init-template
196
+ happy path
197
+ should return no error
198
+ should call ensureDir with correct params
199
+ should call npm init with correct parameters
200
+ should call installTemplate with correct parameters
201
+ should call scaffold with correct parameters
202
+ should call npm install with correct parameters
203
+ when component folder creation fails
204
+ should return an error
205
+ when npm init fails
206
+ should return an error
207
+ when template compiler installation fails
208
+ should return an error
209
+ when template compiler installation fails
210
+ should return an error
211
+
212
+ cli : domain : local
213
+ when initialising with bare jade
214
+ emits a deprecation notice pointing to the modern runtime
215
+ keeps scaffolding on the package-backed legacy template
216
+ when initialising with bare handlebars
217
+ emits a deprecation notice pointing to the modern runtime
218
+ keeps scaffolding on the package-backed legacy template
219
+ when initialising with oc-template-jade
220
+ ✔ does not emit the legacy deprecation notice
221
+ keeps the selected template and compiler unchanged
222
+ when initialising with oc-template-handlebars
223
+ does not emit the legacy deprecation notice
224
+ keeps the selected template and compiler unchanged
225
+
226
+ cli : domain : mock
227
+ when mocking a static plugin
228
+ should add mock to oc.json
229
+ when mocking a static plugin using a bool value
230
+ should add mock to oc.json
231
+ when mocking a dynamic plugin
232
+ should add mock to oc.json
233
+
234
+ cli : domain : ocConfig
235
+ getOcConfig
236
+ when config file exists and is valid JSON
237
+ should return parsed config with registries
238
+ should return parsed config with development plugins
239
+ should return parsed config with fallback settings
240
+ should include sourcePath in result
241
+ should use default config file path when no path provided
242
+ should use provided path when specified
243
+ when config has deprecated mocks structure
244
+ should merge deprecated mocks into development plugins
245
+ should emit a deprecation notice for the `mocks` block
246
+ when config has both mocks and development plugins
247
+ should prioritize development plugins over deprecated mocks
248
+ when config has no registries
249
+ should return empty registries array
250
+ should not emit a deprecation notice
251
+ when config has no development section
252
+ should return empty plugins object
253
+ when config file does not exist
254
+ should return default config
255
+ when config file contains invalid JSON
256
+ should return default config
257
+ when oc.json is in both root and component folder
258
+ should use components folder oc.json as default
259
+ when oc.json is in root folder but not component folder
260
+ should use root oc.json
261
+ setOcConfig
262
+ when setting valid config
263
+ should write config to file
264
+ should use default config file path when no path provided
265
+ should write stringified JSON with proper formatting
266
+ when setting config with custom path
267
+ should use provided path
268
+ when setting config with mocks structure
269
+ should merge mocks into development plugins
270
+ when setting config with fallback settings
271
+ should preserve fallback settings
272
+
273
+ cli : domain : package-components
274
+ when packaging
275
+ when component is valid
276
+ should add sizes and correctly invoke the callback when template succeed packaging
277
+ when component parameters are not valid
278
+ should add version to package.json file
279
+ when component name is not valid
280
+ should add version to package.json file
281
+
282
+ cli : domain : registry
283
+ registry specified at runtime
284
+ should use the registry specified
285
+ when adding registry
286
+ when registry does not end with "/"
287
+ ✔ should append the slash when doing the request
288
+ should save the file with slashed url
289
+ when publishing to registry
290
+ when no credentials used
291
+ should do the request without authorization header
292
+ should do the request with user-agent including cli version and node details
293
+ when credentials used
294
+ should do the request with authorization header
295
+ should do the request with user-agent including cli version and node details
296
+ when getting preview url
297
+ when href not valid
298
+ should show error message
299
+ when href = /component
300
+ href should be /component/~preview/
301
+ (node:52796) [DEP0169] DeprecationWarning: `url.parse()` behavior is not standardized and prone to errors that have security implications. Use the WHATWG URL API instead. CVEs are not issued for `url.parse()` vulnerabilities.
302
+ when href = /component/1.X.X
303
+ href should be /component/1.X.X/~preview/
304
+ when href = /component?hello=world
305
+ href should be /component/~preview/?hello=world
306
+ when href = /component/?hello=world
307
+ href should be /component/~preview/?hello=world
308
+ when href = /component/1.X.X?hello=world
309
+ href should be /component/1.X.X/~preview/?hello=world
310
+ when href = /component/1.X.X/?hello=world
311
+ href should be /component/1.X.X/~preview/?hello=world
312
+
313
+ cli : domain : url-parser
314
+ when parsing http://www.registry.com/api/v2/component-name
315
+ name should be component-name
316
+ version should be blank
317
+ ✔ registryUrl should be http://www.registry.com/api/v2/
318
+ parameters should be {}
319
+ clientHref should be http://www.registry.com/api/v2/oc-client/client.js
320
+ when parsing http://www.registry.com/component-name/~1.0.0/?hello=world
321
+ name should be component-name
322
+ version should be ~1.0.0
323
+ registryUrl should be http://www.registry.com/
324
+ parameters should be { hello: 'world'}
325
+ clientHref should be http://www.registry.com/oc-client/client.js
326
+ when parsing http://www.registry.com/12345/~1.0.0?hello=world
327
+ name should be 12345
328
+ version should be ~1.0.0
329
+ registryUrl should be http://www.registry.com/
330
+ parameters should be { hello: 'world'}
331
+ ✔ clientHref should be http://www.registry.com/oc-client/client.js
332
+
333
+ cli : domain : watch
334
+ when a file from a component changes
335
+ should return no error
336
+ should return the fileName
337
+ should return the component folder
338
+ when a file from a component whose name matches another component changes
339
+ should return no error
340
+ should return the fileName
341
+ should return the component folder
342
+ when a file from a component on Windows-like path changes
343
+ should return no error
344
+ should return the fileName
345
+ should return the component folder
346
+
347
+ cli : facade : clean
348
+ when cleaning folder
349
+ when folder is already clean
350
+ should show a message
351
+ shouldn't call local.remove
352
+ when folder needs cleaning and --yes flag passed down
353
+ should show a message before removing
354
+ ✔ should remove the folder
355
+ should show a message when done
356
+ when folder needs cleaning and no --yes flag passed down and users says yes
357
+ should show a message before removing
358
+ should prompt the user to confirm
359
+ should then remove the folder
360
+ should show a message when done
361
+ when folder needs cleaning and no --yes flag passed down and users says no
362
+ should show a message before removing
363
+ should prompt the user to confirm
364
+ ✔ shouldn't remove the folder
365
+ when removing causes an error
366
+ should show a message before removing
367
+ should try removing the folder
368
+ should show an error message at the end
369
+
370
+ cli : facade : dev
371
+ when running a dev version of the registry
372
+ when the directory is not found
373
+ should show an error
374
+ when the directory does not contain any valid component
375
+ should show an error
376
+ when testing livereload refresh sequencing bugfix
377
+ should call refreshLiveReload AFTER packageComponents completes
378
+ should handle both single component and all components refresh sequencing
379
+
380
+ cli : facade : init
381
+ when initialising a new component
382
+ when the component is an empty string
383
+ should show an error
384
+ when the component has a non valid name
385
+ ✔ should show an error
386
+ when the template is of a non valid type
387
+ should show an error
388
+ when an error happens
389
+ should show an error
390
+ when the component has relative path
391
+ should show a correct name in the log message
392
+ should show a correct path in the log message
393
+ when succeeds
394
+ should show a message
395
+
396
+ cli : facade : mock
397
+ when mocking plugin
398
+ when it succeeds
399
+ should show a confirmation message
400
+
401
+ cli : facade : package
402
+ before packaging a component
403
+ should always show a message
404
+ when packaging
405
+ when a component is not valid
406
+ should show an error
407
+ when a component is valid
408
+ should package and show success message
409
+ when creating tar.gz archive
410
+ ✔ should not compress when option set to false
411
+ when compression is successful
412
+ should show a message for success
413
+ when compression fails
414
+ should show a message for failure
415
+
416
+ cli : facade : preview
417
+ when previewing not valid component
418
+ should not open any preview
419
+ should show error message
420
+ when previewing valid component
421
+ should open /component/~preview/
422
+
423
+ cli : facade : publish
424
+ when publishing component
425
+ when api is not valid
426
+ should show an error
427
+ when api is valid
428
+ should show a message
429
+ compiling component /Users/Ricardo.Agullo/Work/opencomponents/oc/packages/oc/test/fixtures/components/hello-world
430
+ should take precedence over the registries set through oc.json
431
+ when packaging
432
+ when a component is not valid
433
+ should show an error
434
+ when a component is valid
435
+ when creating tar.gz archive
436
+ should show a message
437
+ when publishing
438
+ should show a message
439
+ should publish to all registries
440
+ should pass supplied credentials on the first publish attempt
441
+ when a generic error happens
442
+ should show an error
443
+ when a generic error happens from the api
444
+ should show an error
445
+ when using an old cli
446
+ should show an error
447
+ when using an old node version
448
+ should show an error
449
+ when registry requires authentication
450
+ should prompt for credentials
451
+ when credentials are prepopulated
452
+ should not prompt for credentials
453
+ when it succeeds
454
+ should show a message
455
+ should remove the compressed package
456
+ when skipping packaging
457
+ should publish the package to all registries
458
+ should skip packaging
459
+ ✔ should show an error message if the package folder does not exist
460
+
461
+ cli : facade : registry : add
462
+ when adding a not valid registry
463
+ should show the error
464
+ when adding a valid registry
465
+ should show a confirmation message
466
+
467
+ cli : facade : registry : ls
468
+ when no registries linked to the app
469
+ should introduce the list of registries
470
+ should log an error
471
+ when registries linked to the app
472
+ should introduce the list of registries
473
+ ✔ should list the linked registries
474
+
475
+ cli : facade : registry : migrate-metadata
476
+ should backfill metadata from the configured registry storage
477
+ should load native ESM registry config modules
478
+ should pass top-level manageSchema to the configured metadata adapter
479
+ should scan storage directories when components-details.json is missing
480
+ should close the metadata store even when backfill fails
481
+ ✔ should fail when metadata config is missing
482
+
483
+ cli : facade : registry : remove
484
+ when removing a registry and having some problem removing it
485
+ should show the error
486
+ when removing a valid registry
487
+ should show a confirmation message
488
+
489
+ cli : facade : validate
490
+ when validating a component
491
+ when validation succeeds
492
+ should get registries
493
+ should package the component
494
+ should validate against registry
495
+ should log success message
496
+ when skipPackage option is used
497
+ should not package the component
498
+ should validate against registry
499
+ when validation fails
500
+ should throw an error
501
+ when multiple registries are provided
502
+ should not call registry.get
503
+ should validate against both registries
504
+
505
+ cli : programmatic-api
506
+ cmd: cli.dev
507
+ should be function
508
+ should correctly wrap the related facade
509
+ cmd: cli.init
510
+ should be function
511
+ should correctly wrap the related facade
512
+ cmd: cli.mock
513
+ should be function
514
+ should correctly wrap the related facade
515
+ cmd: cli.package
516
+ should be function
517
+ should correctly wrap the related facade
518
+ cmd: cli.publish
519
+ should be function
520
+ should correctly wrap the related facade
521
+ cmd: cli.preview
522
+ should be function
523
+ should correctly wrap the related facade
524
+ cmd: cli.registry.add
525
+ should be function
526
+ ✔ should correctly wrap the related facade
527
+ cmd: cli.registry.ls
528
+ should be function
529
+ should correctly wrap the related facade
530
+ cmd: cli.registry.remove
531
+ should be function
532
+ ✔ should correctly wrap the related facade
533
+
534
+ cli : validate-command : valid
535
+ given "registry add"
536
+ "registry" should be a valid command
537
+ given "registry add"
538
+ "add" should be a valid command
539
+ given "registry ls"
540
+ ✔ "ls" should be a valid command
541
+
542
+ cli : validate-command : invalid
543
+ given "foo bar"
544
+ "foo" should be an invalid command
545
+ given "registry bar"
546
+ "bar" should be an invalid command
547
+
548
+ registry : app-start
549
+ when registry starting
550
+ when not in local mode
551
+ when oc-client found on library
552
+ should not publish it
553
+ when oc-client not found on library
554
+ should publish it
555
+
556
+ registry : domain : components-cache
557
+ when library does not contain components.json
558
+ when getting the json fails
559
+ should throw with the error message
560
+ when initialising the cache
561
+ should try fetching the components.json and check components
562
+ should scan for directories to fetch components and versions
563
+ should then save the directories' data to components.json file in cdn
564
+ should start the refresh loop
565
+ when library contains outdated components.json
566
+ when initialising the cache
567
+ should fetch the components.json
568
+ should verify new versions
569
+ should ignore corrupted versions and generate an error event
570
+ should scan for directories to fetch components and versions
571
+ should then save the directories' data to components.json file in cdn
572
+ should start the refresh loop
573
+ when library contains updated components.json
574
+ when initialising the cache
575
+ should fetch the components.json
576
+ should scan for directories to fetch components and versions
577
+ should not modify components.json
578
+ should use it as a source of truth
579
+ ✔ should start the refresh loop
580
+ when refreshing the cache
581
+ when refresh errors
582
+ should generate an error event
583
+ when refresh does not generate errors
584
+ should have started, stopped and restarted the refresh loop
585
+ ✔ should do list requests to cdn
586
+ should do write request to cdn
587
+ should refresh the values
588
+ when metadata store is configured
589
+ should hydrate the cache from the metadata store
590
+ should read the latest metadata snapshot on get
591
+ should not scan or write storage metadata files
592
+ should keep serving cached metadata when polling fails
593
+ ✔ should not restart the polling loop when closed during a poll
594
+
595
+ registry : domain : metadata-index
596
+ should reuse the hydrated snapshot until refreshed
597
+ ✔ should update the hydrated snapshot when a row is added
598
+
599
+ registry : domain : components-details
600
+ get()
601
+ when details file exists on cdn
602
+ should not error
603
+ should return the details
604
+ should fetch the details from components-details.json
605
+ should cache the details after the first fetch
606
+ when details file does not exist on cdn
607
+ should return an error
608
+ refresh()
609
+ when details file exists on cdn
610
+ when details file is outdated on cdn
611
+ should fetch the component details for new components
612
+ when component details fetch fails
613
+ should return an error
614
+ should fire an error event
615
+ when component details fetch succeeds
616
+ should save the updated component details to file
617
+ when component details save fails
618
+ should return an error
619
+ should fire an error event
620
+ when component details save succeeds
621
+ should not error
622
+ should return result
623
+ should cache the refreshed details
624
+ when details file is up-to-date on cdn
625
+ should not error
626
+ ✔ should not save it
627
+ should return the result
628
+ when details file does not exist on cdn
629
+ should fetch the component details for new components
630
+ when component details fetch fails
631
+ should return an error
632
+ should fire an error event
633
+ when component details fetch succeeds
634
+ should save the updated component details to file
635
+ when component details save fails
636
+ should return an error
637
+ should fire an error event
638
+ when component details save succeeds
639
+ should not error
640
+ should return result
641
+ polling
642
+ should start the polling loop using the configured interval
643
+ should clear the previous loop when refreshing again
644
+ should restart the loop after each poll
645
+ should not restart the polling loop when closed during a poll
646
+ should update the cache when the polled data is newer
647
+ ✔ should keep the cached data when the polled data is not newer
648
+ should fire an error event when polling fails
649
+ when metadata store is configured
650
+ should hydrate the details from the metadata store
651
+ ✔ should not read or write storage metadata files
652
+ should not start a second polling loop
653
+
654
+ registry : domain : events-handler
655
+ when requiring it multiple times
656
+ should be a singleton
657
+ when firing an event that has multiple subscribers
658
+ ✔ should call the subscribers in the correct order
659
+ should call the subscribers with the event payload
660
+ when checking for subscribers
661
+ should reflect on, off, and reset changes
662
+ when subscribing a request event using a not valid handler
663
+ should throw an error
664
+ when unsubscribing a request event
665
+ should throw an error if callback is not a function
666
+ ✔ should not throw an error if event name is not registered
667
+ should remove the specific callback but not the others
668
+
669
+ registry : domain : extract-package
670
+ when successfully extracting package
671
+ should decompress tar.gz file
672
+ should respond
673
+ when extracting package fails
674
+ should respond with error
675
+
676
+ registry : domain : http-server : express-adapter
677
+ supports promise-based listen and close
678
+ ✔ preserves callback-based listen and close with a deprecation warning
679
+
680
+ registry : domain : metadata-index
681
+ getComponentsListFromRows()
682
+ should group versions per component and sort them by semver
683
+ should derive lastEdit from the most recent publishDate
684
+ should produce lastEdit 0 for an empty registry
685
+ getComponentsDetailsFromRows()
686
+ ✔ should map rows to per-version details and omit absent templateSize
687
+ getComponentRow()
688
+ ✔ should build a row from a package.json component
689
+ should default publishDate to 0 when the component has no date
690
+ createMetadataIndex()
691
+ refresh() / get() / getOrRefresh()
692
+ should hydrate both caches from a single getAllComponents call
693
+ get() should return undefined before any hydration
694
+ getOrRefresh() should hydrate once then reuse the snapshot
695
+ should skip full rehydration when the metadata change token is unchanged
696
+ ✔ should rehydrate when the metadata change token changes
697
+ should force a periodic full rehydration even when the token is unchanged
698
+ ✔ should ignore a stale refresh result when a local add lands while it is in flight
699
+ add()
700
+ ✔ should build a snapshot from a single row when none exists yet
701
+ should append a new version to an existing component in semver order
702
+ should add a brand-new component without touching others
703
+ ✔ should be a no-op when the version already exists
704
+ should not advance lastEdit backwards
705
+ should not mutate a previously returned snapshot (immutability)
706
+ ✔ should share untouched component entries by reference with the new snapshot
707
+
708
+ registry : domain : metadata-migration
709
+ getComponentRowsFromComponentsDetails()
710
+ should map components-details.json content to metadata rows
711
+ backfillMetadataRows()
712
+ should insert rows into the metadata store
713
+ should treat existing metadata rows as skipped
714
+ should insert rows concurrently with a bounded limit
715
+ should treat active metadata reservations as skipped
716
+ should rethrow non-idempotent metadata insert errors
717
+ backfillMetadataFromComponentsDetails()
718
+ should backfill rows from components details
719
+ exportLegacyMetadataFiles()
720
+ should export metadata rows to legacy components files
721
+ getComponentRowsFromStorageDirectories()
722
+ should map component package.json files from storage directories to metadata rows
723
+ should return no rows when the components directory does not exist
724
+ backfillMetadataFromStorageDetails()
725
+ should read components-details.json from storage and backfill rows
726
+ ✔ should scan storage directories when components-details.json is missing
727
+
728
+ registry : routes : helpers : nested-renderer
729
+ when rendering nested component
730
+ when req is not valid
731
+ when componentName not valid
732
+ should throw an error
733
+ when componentName empty
734
+ should throw an error
735
+ when requesting a not existent component
736
+ should return an error in the callback
737
+ when req is valid
738
+ when all params specified
739
+ should get the html result
740
+ should make correct request to renderer
741
+ should get no error
742
+ when minimal params specified
743
+ ✔ should get the html result
744
+ should make correct request to renderer
745
+ should get no error
746
+ when rendering nested components
747
+ when limiting concurrency
748
+ should preserve order and run at most ten renders at once
749
+ when req is not valid
750
+ when components not valid
751
+ should throw an error
752
+ when components empty
753
+ should throw an error
754
+ when requesting not existent components
755
+ should return no error in the callback
756
+ should return error in result callback
757
+ when req is valid
758
+ when all params specified
759
+ should get the html result
760
+ should make correct request to renderer
761
+ should get no error
762
+ when minimal params specified
763
+ should get the html result
764
+ should make correct request to renderer
765
+ ✔ should get no error
766
+
767
+ registry : domain : options-sanitiser : deprecations
768
+ when the legacy "s3" shortcut is provided
769
+ emits a deprecation notice pointing to storage.adapter/storage.options (308ms)
770
+ when "refreshInterval" is provided alongside storage
771
+ emits a deprecation notice pointing to pollingInterval (108ms)
772
+ ✔ emits a deprecation notice even when the value is falsy (85ms)
773
+ forwards the value into storage.options, initialising it if missing (99ms)
774
+ when "discovery" is a boolean
775
+ emits a deprecation notice pointing to the object form (86ms)
776
+ when "discovery" is already an object
777
+ does not emit a deprecation notice (79ms)
778
+ when none of the deprecated options are used
779
+ does not emit any deprecation notice (78ms)
780
+
781
+ registry : domain : options-sanitiser
782
+ when options is empty
783
+ should set prefix to "/" (69ms)
784
+ should set tempDir to "./temp/" (71ms)
785
+ should set hotReloading to false (69ms)
786
+ should set verbosity to 0 (63ms)
787
+ should set customHeadersToSkipOnWeakVersion to [] (66ms)
788
+ should set cors to {"origin":"*","credentials":true,"allowedHeaders":"Origin, X-Requested-With, Content-Type, Accept, traceparent","methods":"GET, OPTIONS, PUT, POST"} (61ms)
789
+ should set timeout to 120000 (60ms)
790
+ should set dataProvider to {"enabled":true} (56ms)
791
+ should default to the Express HTTP server adapter (112ms)
792
+ dataProvider configuration
793
+ should keep dataProvider.enabled when explicitly disabled (58ms)
794
+ ✔ should default dataProvider.enabled to true when the object is partial (56ms)
795
+ server adapter configuration
796
+ when no server adapter is provided
797
+ should default to the Express HTTP server adapter (57ms)
798
+ when no server options are provided
799
+ should pass the port to the server options (56ms)
800
+ when server options are provided
801
+ should leave them untouched (63ms)
802
+ when verbosity is provided
803
+ should leave value untouched (63ms)
804
+ customHeadersToSkipOnWeakVersion
805
+ when it contains valid elements
806
+ should convert the array elements to lower case (57ms)
807
+ cors configuration
808
+ should normalize partial custom values (58ms)
809
+ fallbackRegistryUrl
810
+ when fallbackRegistryUrl doesn't contain / at the end of url
811
+ should add `/` at the end of url (59ms)
812
+ when fallbackRegistryUrl contains `/` at the end of url
813
+ should not modify fallbackRegistryUrl url (58ms)
814
+ prefix and baseUrl sanitization
815
+ should support various scenarios correctly (785ms)
816
+ when pollingInterval
817
+ is provided
818
+ should not modify it (49ms)
819
+ is not provided
820
+ should initialize it as 5000 (55ms)
821
+ when templates
822
+ is provided
823
+ should not modify it
824
+ is not provided
825
+ should initialize it as 5000 (56ms)
826
+ when env
827
+ is provided
828
+ should not modify it (58ms)
829
+ is not provided
830
+ should initialize it as an empty {} (56ms)
831
+ storage adapter configuration
832
+ when legacy "s3" param
833
+ is provided
834
+ should create a storage.adapter configuration accordingly (115ms)
835
+ (node:52796) DeprecationWarning: The `s3` config shortcut is deprecated and will be removed in OpenComponents v1 - use explicit `storage.adapter`/`storage.options` instead.
836
+ when no storage adapter
837
+ is provided
838
+ ✔ should default to the oc-s3-storage-adapter (53ms)
839
+ when refreshInterval
840
+ is provided
841
+ should pass the refreshInterval to the storage options (53ms)
842
+ (node:52796) DeprecationWarning: The `refreshInterval` option is deprecated and will be removed in OpenComponents v1 - use `pollingInterval` instead.
843
+ when verbosity
844
+ is provided
845
+ should pass the verbosity to the storage options (52ms)
846
+ when storage.path
847
+ does not include a protocol
848
+ should sanitize the path to rely on the https protocol (54ms)
849
+ does include a prefix
850
+ should not modify it (55ms)
851
+
852
+ registry : domain : plugins-initialiser
853
+ should keep deferred plugins isolated across concurrent initialisations
854
+ when initialising not valid plugins
855
+ when plugin not registered correctly
856
+ should error
857
+ when plugin is anonymous
858
+ should error
859
+ when plugin does not expose a register method
860
+ should error
861
+ when plugin does not expose an execute method
862
+ should error
863
+ when initialising valid plugins
864
+ (node:52796) DeprecationWarning: Plugin register callbacks is deprecated and will be removed in OpenComponents v1 - use an async register(options, dependencies) function instead.
865
+ should register plugin with passed options
866
+ should expose the functionalities using the plugin names
867
+ should expose descriptions on the plugin functions if defined
868
+ should be make the functionality usable
869
+ when initialising promise-based plugins
870
+ awaits their registration and exposes their handlers
871
+ rejects when async registration fails
872
+ ✔ uses the returned promise when the callback also completes
873
+ when plugin specifies dependencies
874
+ should provide the getValue register method with the required dependent plugins
875
+ when plugins have a circular dependency
876
+ should throw an error
877
+ when plugin depends on a plugin that is not registered
878
+ should throw an error
879
+ when plugin chain requires multiple passes
880
+ should defer the initalisation of the plugin until all dependencies have bee registered
881
+
882
+ registry : domain : register-templates
883
+ when templates get registered without additional templates
884
+ should correctly register core-templates
885
+ when templates get registered with additional templates
886
+ should correctly register core-templates & extra templates
887
+ should replace the devurl for the url field
888
+ and additional template is already part of core-templates
889
+ should correctly register core-templates only
890
+
891
+ registry : domain : repository : manifest cache
892
+ caches repeated exact and range requests after resolving an exact version
893
+ coalesces concurrent loads and retries after a rejected load
894
+ recursively freezes cached state while returning a fresh top-level result
895
+ bounds manifests at 1000 entries and evicts the true LRU key
896
+ does not share manifest values between repository instances
897
+ caches local source and packaged manifests only when hot reloading is disabled
898
+ prevents invalidated legacy in-flight loads from repopulating the cache
899
+ keeps older in-flight cleanup from deleting a newer load
900
+ reconciles genuinely new concurrent legacy publishes before later reads
901
+ invalidates metadata manifests only after a successful commit
902
+ keeps invalidation state bounded to live loads across 1001 publishes
903
+
904
+ registry : domain : repository
905
+ when on cdn configuration
906
+ when getting the list of available components
907
+ should fetch the list from the cache
908
+ should respond without an error
909
+ should list the components
910
+ when getting the components details
911
+ should not error
912
+ should return the result
913
+ when getting the list of supported templates
914
+ when no templates are specificed on the configuaration
915
+ should return core templates
916
+ when the templates specificed on the configuaration are core-templates
917
+ should only return uniques templates
918
+ when templates specificed on the configuaration are not installed
919
+ should throw an error
920
+ when trying to get a not valid component
921
+ when the component does not exist
922
+ should respond with a proper error
923
+ when the get component info fails
924
+ should respond with a proper error
925
+ when the component exists but version does not
926
+ should respond with a proper error
927
+ when getting an existing component
928
+ should respond without an error
929
+ should fetch the versions' list from the cache
930
+ should fetch the component info from the correct package.json file
931
+ ✔ should return the component info
932
+ when getting the .env file
933
+ should respond without an error
934
+ should return the component info
935
+ when getting a static file url
936
+ should be using the static redirector from registry
937
+ when publishing a component
938
+ when component has a not valid name
939
+ should respond with an error
940
+ when component has a not valid version
941
+ should respond with an error
942
+ when component has a valid name and version
943
+ when component with same name and version is already in library
944
+ should respond with an error
945
+ when is in check mode only
946
+ should not refresh cached components list
947
+ should not refresh componens details
948
+ should not publish components
949
+ when component with same name and version is not in library
950
+ should refresh cached components list
951
+ should refresh componens details
952
+ ✔ should store the component in the correct directory
953
+ when metadata store is configured
954
+ should initialise the metadata store before loading caches
955
+ should pass top-level manageSchema to the metadata adapter
956
+ should not reconcile from storage by default
957
+ should reconcile from storage before loading caches when enabled
958
+ should keep startup reconciliation idempotent
959
+ should export legacy files after startup cache hydration when enabled
960
+ ✔ should fail startup when the metadata store is down
961
+ should not export legacy files on publish (export is timer-driven)
962
+ should export legacy files on the configured interval and stop after close
963
+ should not reschedule legacy export when closed while an export is running
964
+ when publishing succeeds
965
+ should reserve, upload, then commit the version
966
+ should not refresh metadata caches from the store after publish
967
+ when metadata store reports an existing version
968
+ should return the existing registry duplicate-version error
969
+ when metadata store is down during publish
970
+ should fail the publish after uploading statics and abort the reservation
971
+ when publishing the same version concurrently
972
+ ✔ should reserve one publish and reject the duplicate before storage upload
973
+ when publishing different versions concurrently
974
+ should commit both metadata rows
975
+ close()
976
+ should stop cache polling before closing the metadata store
977
+ should resolve when the metadata store has no close hook
978
+ when refreshing details is slow
979
+ should resolve publish before details refresh finishes
980
+ when on local configuration
981
+ when getting the list of available components
982
+ ✔ should respond without an error
983
+ should list the components
984
+ when trying to get a not valid component
985
+ when the component does not exist
986
+ should respond with a proper error
987
+ when the component exists but version does not
988
+ should respond with a proper error
989
+ when getting an existing component
990
+ should respond without an error
991
+ should return the component info
992
+ when getting a static file url
993
+ should be using the static redirector from registry
994
+ when trying to publish a component
995
+ should respond with an error
996
+
997
+ registry : domain : require-wrapper
998
+ when using the require wrapper in a clear context
999
+ when requiring a dependency
1000
+ should correctly make the dependency require-able
1001
+ when requiring an unrecognised dependency
1002
+ should correctly throw an error
1003
+ when requiring a core dependency
1004
+ ✔ should correctly require and use the dependency
1005
+ when requiring a core dependency with node: prefix
1006
+ should correctly require and use the dependency
1007
+ when requiring an unvetted core dependency
1008
+ should correctly throw an error
1009
+ when requiring a dependency with a relative path
1010
+ should correctly make the dependency require-able
1011
+ when requiring a dependency with a relative path that does not exist
1012
+ should correctly throw an error
1013
+ when try-require fails with absolute path but succeeds with package name
1014
+ should fall back to requiring by package name
1015
+ when a core module and npm package share the same name
1016
+ ✔ should prefer the core module
1017
+
1018
+ registry : domain : sanitiser
1019
+ when sanitising component's request parameters
1020
+ when component has boolean parameter
1021
+ should convert string to boolean when true
1022
+ should convert string to boolean when true
1023
+ when component has string parameter
1024
+ should convert null to empty
1025
+ when component has number parameter
1026
+ should convert string to number
1027
+ when component have not defined optional parameter
1028
+ should keep the parameter as it is
1029
+
1030
+ registry : domain : server-adapter
1031
+ when given an adapter factory
1032
+ should return the created adapter
1033
+ when given an adapter instance
1034
+ should return the adapter untouched
1035
+ when the factory returns an invalid adapter
1036
+ should throw
1037
+
1038
+ registry : domain : adapter
1039
+ when is not a legacy adapter
1040
+ returns the same adapter
1041
+ when is a legacy adapter
1042
+ returns a universalified adapter
1043
+ when is an official adapter
1044
+ Shows a deprecation warning asking to upgrade
1045
+ when is not an official adapter
1046
+ Shows a deprecation warning about callbacks
1047
+
1048
+ registry : domain : url-builder
1049
+ when building component url
1050
+ when building component with just component name
1051
+ should be baseUrl/componentName
1052
+ when building component with version
1053
+ should be baseUrl/componentName/version
1054
+ when building component with query string parameters
1055
+ when building component with number parameter
1056
+ should be baseUrl/componentName/version/?param=123
1057
+ when building component with url parameter
1058
+ should be baseUrl/componentName/version/?param=encodedUrl
1059
+ when building component preview url
1060
+ when building url with just component name
1061
+ should be baseUrl/componentName
1062
+ when building url with version
1063
+ should be baseUrl/componentName/version
1064
+ when building url with query string parameters
1065
+ when building component with number parameter
1066
+ should be baseUrl/componentName/version/?param=123
1067
+ when building component with url parameter
1068
+ should be baseUrl/componentName/version/?param=encodedUrl
1069
+
1070
+ registry : domain : validator
1071
+ when validating registry configuration
1072
+ when configuration null
1073
+ should not be valid
1074
+ when configuration empty
1075
+ ✔ should not be valid
1076
+ prefix
1077
+ when prefix does not start with /
1078
+ should not be valid
1079
+ when prefix does not end with /
1080
+ should not be valid
1081
+ publishAuth
1082
+ when not specified
1083
+ should be valid
1084
+ when specified and not supported
1085
+ should not be valid
1086
+ when specified and basic
1087
+ when username and password specified
1088
+ should be valid
1089
+ when multiple logins specified
1090
+ when all logins have username and password
1091
+ should be valid
1092
+ when some logins are missing username or password
1093
+ should not be valid
1094
+ when logins array is empty
1095
+ should not be valid
1096
+ when username and password not specified
1097
+ should not be valid
1098
+ dependencies
1099
+ when not specified
1100
+ should be valid
1101
+ when specified
1102
+ when it is an array
1103
+ should be valid
1104
+ when it is not an array
1105
+ should not be valid
1106
+ cors
1107
+ should accept partial CORS configuration
1108
+ should reject a non-object CORS configuration
1109
+ should reject an invalid credentials value
1110
+ should reject an empty origin
1111
+ should reject non-string allowed headers
1112
+ should reject non-string methods
1113
+ s3
1114
+ when local=true
1115
+ should be valid
1116
+ when not in local mode
1117
+ when s3 settings empty
1118
+ should not be valid
1119
+ when s3 setting is missing bucket
1120
+ should not be valid
1121
+ when s3 setting is missing key
1122
+ should not be valid
1123
+ when s3 setting is missing region
1124
+ should not be valid
1125
+ when s3 setting is missing secret
1126
+ should not be valid
1127
+ when s3 setting do not use key/secret - EC2 IAM Role use case
1128
+ should be valid
1129
+ when s3 setting contains all properties
1130
+ should be valid
1131
+ routes
1132
+ when not specified
1133
+ should be valid
1134
+ when specified
1135
+ when not an array
1136
+ should not be valid
1137
+ when route does not contain route
1138
+ should not be valid
1139
+ when route does not contain handler
1140
+ should not be valid
1141
+ when route does not contain method
1142
+ should not be valid
1143
+ when route contains handler that is not a function or a string
1144
+ should not be valid
1145
+ when route overrides prefix namespace
1146
+ should not be valid
1147
+ metadata
1148
+ should pass top-level manageSchema to the metadata adapter
1149
+ should reject invalid export legacy files intervals
1150
+ should reject export legacy files interval without export legacy files enabled
1151
+ should accept export legacy files interval when export legacy files is enabled
1152
+ when adapter is missing
1153
+ should not be valid
1154
+ when adapter configuration is invalid
1155
+ should not be valid
1156
+ when adapter configuration is valid
1157
+ should be valid
1158
+ customHeadersToSkipOnWeakVersion
1159
+ when customHeadersToSkipOnWeakVersion is not an array
1160
+ should not be valid
1161
+ when customHeadersToSkipOnWeakVersion is an array but contains non-string elements
1162
+ should not be valid
1163
+ when customHeadersToSkipOnWeakVersion is a non-empty array of strings
1164
+ should be valid
1165
+ when validating component request by parameter
1166
+ when component have not parameters
1167
+ should be valid
1168
+ when component have not mandatory parameters
1169
+ should be valid when non mandatory parameters not provided
1170
+ should be valid when non mandatory parameters provided in a valid format
1171
+ should be not valid when non mandatory parameters provided in a non valid format
1172
+ when component have mandatory parameters
1173
+ should not be valid when mandatory parameter not provided
1174
+ when mandatory string parameter provided
1175
+ should be valid when parameter in a valid form
1176
+ should not be valid when parameter in a non valid form
1177
+ ✔ should be valid when parameter is an empty string
1178
+ when non mandatory number provided
1179
+ should not be valid when provided in a non valid form
1180
+ should be valid when 0
1181
+ when non mandatory boolean provided
1182
+ should not be valid when provided in a non valid form
1183
+ when mandatory number parameter provided
1184
+ ✔ should be valid when parameter in a valid form
1185
+ should not be valid when parameter in a non valid form
1186
+ should not be valid when parameter is null
1187
+ when mandatory boolean parameter provided
1188
+ should be valid when parameter in a valid form
1189
+ should not be valid when parameter in a non valid form
1190
+ should not be valid when parameter is null
1191
+ should not be valid when parameter is undefined
1192
+ should not be valid when parameter not provided
1193
+ when component parameters have enum constraints
1194
+ when string parameter has enum constraint
1195
+ should be valid when parameter value is in enum
1196
+ should be valid when parameter value is another valid enum value
1197
+ should not be valid when parameter value is not in enum
1198
+ should not be valid when parameter value is case sensitive
1199
+ when number parameter has enum constraint
1200
+ should be valid when parameter value is in enum
1201
+ should be valid when parameter value is another valid enum value
1202
+ should not be valid when parameter value is not in enum
1203
+ should not be valid when parameter value is zero but not in enum
1204
+ when boolean parameter has enum constraint
1205
+ ✔ should be valid when parameter value is in enum
1206
+ ✔ should not be valid when parameter value is not in enum
1207
+ when parameter has both type and enum validation
1208
+ should not be valid when parameter has wrong type
1209
+ should not be valid when parameter has correct type but wrong enum value
1210
+ when multiple parameters have enum constraints
1211
+ should be valid when all parameters have valid enum values
1212
+ should not be valid when one parameter has invalid enum value
1213
+ should not be valid when multiple parameters have invalid enum values
1214
+ when parameter has empty enum array
1215
+ should not be valid when any value is provided
1216
+ when parameter has single value enum
1217
+ should be valid when parameter matches the single enum value
1218
+ should not be valid when parameter does not match the single enum value
1219
+ when validating component name for new candidate
1220
+ when name has spaces
1221
+ ✔ should not be valid
1222
+ when name has not allowed characters
1223
+ should not be valid
1224
+ when name has alphanumeric characters, _ or -
1225
+ should be valid
1226
+ when name is reserved
1227
+ should not be valid
1228
+ when validating component version for new candidate
1229
+ when version already exists
1230
+ should not be valid
1231
+ when version does not exist
1232
+ should be valid
1233
+ when validating component package for new candidate
1234
+ when package not valid
1235
+ should not be valid when uploaded files is empty
1236
+ should not be valid when uploaded package consists of multiple files
1237
+ ✔ should not be valid when file has not the proper file extension
1238
+ should not be valid when file has been truncated
1239
+ should not be valid when file has wrong mimetype
1240
+ when custom validation provided
1241
+ when package.json does not contain mandatory fields
1242
+ should not be valid
1243
+ should return the error
1244
+ when package.json contains mandatory fields
1245
+ should be valid
1246
+ when package is valid
1247
+ should be valid with mimetype application/octet-stream
1248
+ should be valid with mimetype application/gzip
1249
+ when validating component plugin requirements
1250
+ when component does not require any plugin
1251
+ should be valid
1252
+ when component requires plugin
1253
+ when registry does not support plugin
1254
+ ✔ should not be valid
1255
+ should list missing dependencies
1256
+ when registry supports plugin
1257
+ should be valid
1258
+ when validating CLI OC version in request headers
1259
+ when user-agent header is not specified
1260
+ should be invalid
1261
+ should suggest correct version of CLI
1262
+ when user-agent header doesn't have correct format
1263
+ should be invalid
1264
+ should suggest correct version of CLI
1265
+ when OC CLI version in user-agent header is lower than Registry version
1266
+ should be invalid
1267
+ should suggest correct version of CLI
1268
+ when OC CLI version in user-agent header is equal to Registry version (same major.minor)
1269
+ should be valid
1270
+ should not return an error
1271
+ when OC CLI version in user-agent header is higher than Registry version
1272
+ should be valid
1273
+ should not return an error
1274
+ when OC CLI version has different patch version but same major.minor
1275
+ should be valid
1276
+ should not return an error
1277
+ when validating node engine version in request headers
1278
+ when user-agent header is not specified
1279
+ should be invalid
1280
+ should suggest correct version of node engine
1281
+ when user-agent header doesn't have correct format
1282
+ should be invalid
1283
+ should suggest correct version of node engine
1284
+ when node version in user-agent header is lower than Registry version of node
1285
+ should be invalid
1286
+ should suggest correct version of node engine
1287
+ when node version in user-agent header is equal to Registry version of node
1288
+ should be valid
1289
+ should not return an error
1290
+ when node version in user-agent header is higher than Registry version of node
1291
+ should be valid
1292
+ should not return an error
1293
+
1294
+ registry : domain : version-handler
1295
+ when getting component
1296
+ when versions not available
1297
+ ✔ should return an undefined when a version is specified
1298
+ should return an undefined when a version is not specified
1299
+ when versions available
1300
+ should return the latest when a version is not specified
1301
+ should return undefined when not valid version specified
1302
+ should return an exact existing version
1303
+ should return undefined for a missing exact version
1304
+ should return the latest when latest version specified
1305
+ should return the latest minor+patch of a version when minor omitted
1306
+ should return the latest path for minor when patch omitted
1307
+ should return the latest patch of a version when ~ used on patch level
1308
+ should return the latest patch version when ~ used on minor level
1309
+ should return the latest patch of a version when X used on patch
1310
+ should return the latest patch of a version when X used on minor
1311
+ when only pre release versions available
1312
+ should return the latest when a version is not specified
1313
+ should return undefined when not valid version specified
1314
+ should return the latest when latest version specified
1315
+ should return the version specified
1316
+ when mix of release and pre-release versions available
1317
+ should return the latest release version when a version is not specified
1318
+ should return the latest when latest version specified
1319
+ should return the version specified
1320
+ when publishing component
1321
+ when version already exists
1322
+ shouldn't be valid
1323
+ when version is available
1324
+ should be valid when major than latest
1325
+ should be valid when major than latest minor of previous major
1326
+ ✔ should be valid when major than latest patch of previous minor
1327
+ should be valid when minor than an existing patch but not existing
1328
+
1329
+ registry : middleware : cors
1330
+ should preserve the default security headers across the HTTP adapter
1331
+ should apply custom security headers across the HTTP adapter
1332
+
1333
+ registry : router : artifact cache
1334
+ shares cold artifact loads between GET and batch routes (42ms)
1335
+
1336
+ registry : routes : component
1337
+ when getting a component with server.js execution timeout
1338
+ should return 500 status code
1339
+ should respond with error message
1340
+ should return component's name and request version
1341
+ when the data provider is disabled in the registry configuration
1342
+ should return 200 status code
1343
+ should not fetch the data provider from the storage
1344
+ should use the request parameters as the view model
1345
+ when getting a component with a server.js that returns undefined data
1346
+ should return 500 status code
1347
+ should respond with error message for undefined data
1348
+ should return component's name and request version
1349
+ when getting a component with server.js execution errors
1350
+ should return 500 status code
1351
+ should respond with error message including missing plugin
1352
+ should return component's name and request version
1353
+ when getting a component with server.js asynchronous execution errors
1354
+ when has error that gets fired on first execution
1355
+ should return 500 status code
1356
+ should respond with error message for component execution error
1357
+ should return component's name and request version
1358
+ when has error that gets fired on following executions
1359
+ should return 200 status code for successful request
1360
+ should return 500 status code when error happens
1361
+ should respond without error for successful request
1362
+ should respond with error message for component execution error
1363
+ should return component's name and request version for both requests
1364
+ when getting a component that implements a plugin
1365
+ when plugin not declared in package.json
1366
+ (node:52796) [DEP0097] DeprecationWarning: Using a domain property in MakeCallback is deprecated. Use the async_context variant of MakeCallback or the AsyncResource class instead. (Triggered by calling processImmediate on process.)
1367
+ should return 500 status code
1368
+ should respond with GENERIC_ERROR error code
1369
+ should respond with error message including missing plugin
1370
+ should return component's name and request version
1371
+ when plugin declared in package.json
1372
+ when registry implements plugin
1373
+ should return 200 status code
1374
+ should use plugin inside compiledView
1375
+ should return component's name and request version
1376
+ when registry does not implement plugin
1377
+ should return 501 status code
1378
+ should respond with PLUGIN_MISSING_FROM_REGISTRY error code
1379
+ should respond with error message including missing plugin
1380
+ should return component's name and request version
1381
+ when getting a component that requires a npm module
1382
+ when registry implements dependency
1383
+ should return 200 status code
1384
+ should use plugin inside compiledView
1385
+ should return component's name and request version
1386
+ when registry does not implement dependency
1387
+ should return 501 status code
1388
+ should respond with DEPENDENCY_MISSING_FROM_REGISTRY error code
1389
+ should respond with error message including missing dependency
1390
+ ✔ should return component's name and request version
1391
+ when getting a component with server.js that sets custom headers with empty customHeadersToSkipOnWeakVersion
1392
+ should return 200 status code
1393
+ should set response headers
1394
+ ✔ should return component's name and request version
1395
+ when getting a component with server.js that sets custom headers with non-empty customHeadersToSkipOnWeakVersion
1396
+ should return 200 status code
1397
+ ✔ should not set response headers
1398
+ should return component's name and request version
1399
+ when getting a simple component with server.js after headers component no custom headers should be set
1400
+ should return 200 status code for the first component
1401
+ should return "response-headers-component" name for the first component's name and request version
1402
+ should set response headers for the first component
1403
+ should return 200 status code for the second component
1404
+ should return "simple-component" name for the second component's name and request version
1405
+ should not set custom response for the second component
1406
+ when getting a component info for a component that sets custom headers
1407
+ should return 200 status code
1408
+ should return no custom headers
1409
+ should return component's name and request version
1410
+ should not return rendered HTML
1411
+
1412
+ registry : routes : components
1413
+ when making valid request for two components
1414
+ should return 200 status code
1415
+ should return a response containing both components
1416
+ should return a response containing components in the correct order
1417
+ should return a response with error code and description for the first component
1418
+ should return a response with rendered html for second component
1419
+ should include 500 status code for first component
1420
+ should include 200 status code for second component
1421
+ should return name and request version for both components
1422
+ when making request for 0 components
1423
+ should return 200 status code
1424
+ ✔ should return a response containing empty array
1425
+ when making valid info request for two components
1426
+ should return 200 status code
1427
+ should return a response containing both components
1428
+ should return a response containing components in the correct order
1429
+ when making info request for 0 components
1430
+ should return 200 status code
1431
+ should return a response containing empty array
1432
+ when making not valid request
1433
+ when not providing components property
1434
+ should return 400 status code
1435
+ should return error details
1436
+ when components property is not an array
1437
+ should return 400 status code
1438
+ should return error details
1439
+ when component does not have name property
1440
+ should return 400 status code
1441
+ should return error details
1442
+ when components do not have name property
1443
+ should return 400 status code
1444
+ should return error details
1445
+ when getting a component that has custom parameters
1446
+ should return a 200 response
1447
+ when getting a component that has missing required parameters
1448
+ should return 400 status code
1449
+ when making valid info request for a component action
1450
+ should return a 200 response
1451
+
1452
+ registry : routes : plugins
1453
+ when is not discoverable
1454
+ should return 401 status code
1455
+ when is discoverable
1456
+ should return the list of dependencies
1457
+
1458
+ registry : routes : helpers : apply-default-values
1459
+ when component deesn't have optional parameters
1460
+ should return requestParameters
1461
+ when component has optional parameters
1462
+ when default value of parameter is not specified
1463
+ when request doesn't specify values of optional parameters
1464
+ should return requestParameters
1465
+ when default value of parameter is specified
1466
+ when request specify values of optional parameters
1467
+ should return requestParameters
1468
+ when request specify values of some optional parameters
1469
+ ✔ should return requestParameters
1470
+ when request doesn't specify values of optional parameters
1471
+ when string parameter is undefined
1472
+ should return requestParameters with default values of optional parameters
1473
+ when string parameter is null
1474
+ should return requestParameters with default values of optional parameters
1475
+
1476
+ registry : routes : helpers : get-available-dependencies
1477
+ happy path
1478
+ should map to structured view-model
1479
+
1480
+ registry : routes : helpers : get-component : artifact cache
1481
+ isolates env, provider, and template artifacts between registries
1482
+ removes a rejected single-flight load so a retry executes again
1483
+ reloads providers and templates but preserves env caching in hot reload
1484
+
1485
+ registry : routes : helpers : get-component-fallback
1486
+ should not forward accept-encoding header when fetching from fallback registry
1487
+
1488
+ registry : routes : helpers : get-component
1489
+ when the component has an env file
1490
+ should put the env data as part of the context, available to the server
1491
+ when getting a component with success
1492
+ should fire a component-retrieved event
1493
+ when getting a component with failure
1494
+ should fire a data-provider-error event
1495
+ should fire a component-retrieved event
1496
+ when the component sends a custom status code
1497
+ should return that status code to the client
1498
+ when rendering a component with a legacy template
1499
+ when oc-client requests an unrendered component and it doesn't provide templates header
1500
+ should return the unrendered version
1501
+ when oc-client requests an unrendered component and it supports the correct template
1502
+ should return the unrendered version
1503
+ when rendering a component with a non legacy template
1504
+ when the registry supports the template
1505
+ when oc-client requests an unrendered component and the client doesn't support it
1506
+ should return the rendered version
1507
+ when oc-client requests an unrendered component and the client supports the correct template
1508
+ should return the unrendered version
1509
+ when the registry doesn't support the template
1510
+ when oc-client requests an unrendered component and the client doesn't support it
1511
+ should return an error
1512
+ when oc-client requests an unrendered component and the client supports the correct template
1513
+ should return an error
1514
+ when concurrent cold renders request the same component
1515
+ should load and compile server.js and the template once
1516
+ when a provider completes before its execution timeout
1517
+ should clear the pending timeout
1518
+
1519
+ registry : routes : helpers : get-components-history
1520
+ when components details are provided
1521
+ composing the single history object
1522
+ ✔ should return the publish date of a component
1523
+ should return the version of a component
1524
+ should return the component name
1525
+ sorting the entries by date
1526
+ should return the publish date of a component
1527
+
1528
+ registry : routes : helpers : is-url-discoverable
1529
+ when url responds with application/json
1530
+ should not be discoverable
1531
+ when url responds with text/html
1532
+ should be discoverable
1533
+
1534
+ registry : routes : manifest mutation isolation
1535
+ renders the index view from a recursively frozen manifest
1536
+ returns unchanged component-info JSON without attaching requestVersion
1537
+ returns unchanged preview JSON without attaching requestVersion
1538
+ renders a component while its repository manifest is recursively frozen
1539
+
1540
+ registry : routes : plugins
1541
+ when is not discoverable
1542
+ should return 401 status code
1543
+ when is discoverable
1544
+ should return the list of plugins
1545
+
1546
+ registry : routes : publish
1547
+ when publish finishes
1548
+ should remove only the uploaded package and extracted package folder
1549
+
1550
+ registry : routes : validate
1551
+ when packageJson is missing in body
1552
+ ✔ should return 400 status
1553
+ should return error message
1554
+ when component name and version are missing
1555
+ should return 400 status
1556
+ should return error message about missing name and version
1557
+ when component name is invalid
1558
+ should return 409 status
1559
+ should return error code and message
1560
+ when component version is invalid
1561
+ should return 409 status
1562
+ should return error code and message
1563
+ when validation is successful
1564
+ should return 200 status
1565
+ should return success message
1566
+ when using URL params for component name and version
1567
+ should return 200 status
1568
+ should return success message
1569
+
1570
+ registry
1571
+ when instanciated
1572
+ when options are not valid
1573
+ ✔ should throw an error
1574
+ when options are valid
1575
+ should instantiate the HTTP server adapter
1576
+ should bind the middleware
1577
+ should instanciate the repository
1578
+ should register a plugin using a promise
1579
+ should emit one deprecation warning for callback forms
1580
+ when starting it
1581
+ when plugins initialiser fails
1582
+ should fail with error
1583
+ should reject the promise with an Error
1584
+ when plugins initialiser succeeds
1585
+ when repository initialisation fails
1586
+ should fail with error
1587
+ when repository initialisation succeeds
1588
+ when app fails to start
1589
+ should fail with error
1590
+ when app starts
1591
+ when http listener errors
1592
+ should fail with error
1593
+ when http listener succeeds
1594
+ should not return error
1595
+ should return the server instance
1596
+ should emit a start event
1597
+ should resolve with the app and server
1598
+ ✔ should invoke a callback once when its promise is awaited
1599
+ ✔ should reject the returned promise when the callback throws
1600
+ should support callback-only adapters through the promise API
1601
+ when http listener emits an error before the listener to start
1602
+ should return error
1603
+ should emit an error event
1604
+ when the configured HTTP server adapter emits an error
1605
+ should emit SERVER_ERROR for adapter errors
1606
+ when closing it
1607
+ should close the repository when the server is not listening
1608
+ should close the server then the repository when listening
1609
+ should resolve after the server and repository close
1610
+ ✔ should reject when the server was not opened
1611
+ should still call the repository close when the server close errors
1612
+ should support callback-only adapters when closing through the promise API
1613
+
1614
+ resources : settings
1615
+ files to watch ignore regex
1616
+ when a legitimate file changes
1617
+ should not ignore it
1618
+ when a file in a github.io repo changes
1619
+ should not ignore it
1620
+ when something in the .git folder changes
1621
+ should ignore it
1622
+ when something in the .idea folder changes
1623
+ should ignore it
1624
+ when node_modules changes
1625
+ should ignore it
1626
+
1627
+ tasks : benchmark assertions
1628
+ accepts compatible workloads and Node minor version differences
1629
+ rejects Node, platform, option, and scenario mismatches
1630
+ enforces RPS and p95 regression direction with exact boundaries
1631
+ rejects zero baseline values
1632
+ enforces package reads and success rate for every repetition
1633
+ requires an explicit baseline for timing thresholds
1634
+ counts public adapter operations and preserves active reads on reset
1635
+
1636
+ tasks : server benchmark verify CLI
1637
+ exits zero for a compatible passing result (268ms)
1638
+ exits nonzero for every mismatch class (2204ms)
1639
+
1640
+ utils : bounded cache
1641
+ rejects invalid capacities
1642
+ evicts the least-recently used entry at capacities one and two
1643
+ promotes updates without growing the cache
1644
+ keeps namespaces distinct and deletes exactly one entry
1645
+ stores falsy values and empty objects
1646
+ fills and clears one instance without changing another
1647
+ bounds 1001 entries at 1000 and evicts the true LRU entry
1648
+
1649
+ utils : dateStringify
1650
+ when the date is provided
1651
+ should return the correct stringified date
1652
+ when the provided data is not valid
1653
+ should return empty string
1654
+
1655
+ utils : deprecate
1656
+ emits a DeprecationWarning containing the subject and replacement
1657
+ only warns once per process for the same id
1658
+ warns independently for different ids
1659
+
1660
+ utils : npm-utils
1661
+ init()
1662
+ when invoked for path/to/component with silent=undefined
1663
+ should spawn the process with correct parameters
1664
+ should return no error
1665
+ should correctly setup on error and on close listeners
1666
+ when invoked for path/to/component with silent=true
1667
+ should spawn the process with correct parameters
1668
+ should return no error
1669
+ should correctly setup on error and on close listeners
1670
+ installDependency()
1671
+ when invoked for installing oc-template-jade-compiler
1672
+ should spawn the process with correct parameters
1673
+ should return no error
1674
+ should return the installation path
1675
+ should correctly setup on error and on close listeners
1676
+ when invoked for installing lodash
1677
+ should spawn the process with correct parameters
1678
+ should return no error
1679
+ should return the installation path
1680
+ should correctly setup on error and on close listeners
1681
+ when invoked for installing underscore
1682
+ should spawn the process with correct parameters
1683
+ should return no error
1684
+ should return the installation path
1685
+ should correctly setup on error and on close listeners
1686
+ when invoked for installing oc-client@~1.2.3
1687
+ should spawn the process with correct parameters
1688
+ should return no error
1689
+ should return the installation path
1690
+ should correctly setup on error and on close listeners
1691
+ installDependencies()
1692
+ when invoked for installing [oc-template-jade-compiler, lodash]
1693
+ should spawn the process with correct parameters
1694
+ ✔ should return no error
1695
+ should return the installation path
1696
+ should correctly setup on error and on close listeners
1697
+ when invoked for installing [moment, lodash]
1698
+ should spawn the process with correct parameters
1699
+ should return no error
1700
+ should return the installation path
1701
+ should correctly setup on error and on close listeners
1702
+ when invoked for installing [underscore, oc-client]
1703
+ should spawn the process with correct parameters
1704
+ should return no error
1705
+ should return the installation path
1706
+ should correctly setup on error and on close listeners
1707
+ when invoked for installing [oc-client@~1.2.3, oc-template-react-compiler]
1708
+ should spawn the process with correct parameters
1709
+ should return no error
1710
+ should return the installation path
1711
+ should correctly setup on error and on close listeners
1712
+
1713
+ utils : stripVersion
1714
+ when a non scoped dependency is provided
1715
+ when a version is included
1716
+ should return the dependency without the version
1717
+ when a version is not included
1718
+ should return the unmodified dependency
1719
+ when a scoped dependency is provided
1720
+ when a version is included
1721
+ should return the dependency without the version
1722
+ when a version is not included
1723
+ should return the unmodified dependency
1724
+
1725
+ registry (ui interface)
1726
+ (node:52796) DeprecationWarning: The boolean form of the `discovery` option is deprecated and will be removed in OpenComponents v1 - use the object form (`discovery: { ui, api, ... }`) instead.
1727
+ 1) "before all" hook in "registry (ui interface)"
1728
+ 2) "after all" hook in "registry (ui interface)"
1729
+
1730
+ registry
1731
+ 3) "before all" hook in "registry"
1732
+ 4) "after all" hook in "registry"
1733
+
1734
+ registry
1735
+ when fallbackRegistryUrl is specified
1736
+ 5) "before all" hook in "when fallbackRegistryUrl is specified"
1737
+ 6) "after all" hook in "when fallbackRegistryUrl is specified"
1738
+
1739
+
1740
+ 939 passing (12s)
1741
+ 6 failing
1742
+
1743
+ 1) registry (ui interface)
1744
+ "before all" hook in "registry (ui interface)":
1745
+ Error: listen EADDRINUSE: address already in use :::3030
1746
+ at Server.setupListenHandle [as _listen2] (node:net:2008:16)
1747
+ at listenInCluster (node:net:2065:12)
1748
+ at Server.listen (node:net:2170:7)
1749
+ at /Users/Ricardo.Agullo/Work/opencomponents/oc/packages/oc/dist/registry/domain/http-server/express-adapter.js:149:26
1750
+ at new Promise (<anonymous>)
1751
+ at ExpressHttpServerAdapter.listen (dist/registry/domain/http-server/express-adapter.js:134:16)
1752
+ at listenAdapter (dist/registry/index.js:77:28)
1753
+ at startPromise (dist/registry/index.js:143:35)
1754
+ at process.processTicksAndRejections (node:internal/process/task_queues:104:5)
1755
+
1756
+ 2) registry (ui interface)
1757
+ "after all" hook in "registry (ui interface)":
1758
+ Error: done() invoked with non-Error: not opened
1759
+ at /Users/Ricardo.Agullo/Work/opencomponents/oc/packages/oc/dist/registry/index.js:123:13
1760
+
1761
+ 3) registry
1762
+ "before all" hook in "registry":
1763
+ Error: listen EADDRINUSE: address already in use :::3030
1764
+ at Server.setupListenHandle [as _listen2] (node:net:2008:16)
1765
+ at listenInCluster (node:net:2065:12)
1766
+ at Server.listen (node:net:2170:7)
1767
+ at /Users/Ricardo.Agullo/Work/opencomponents/oc/packages/oc/dist/registry/domain/http-server/express-adapter.js:149:26
1768
+ at new Promise (<anonymous>)
1769
+ at ExpressHttpServerAdapter.listen (dist/registry/domain/http-server/express-adapter.js:134:16)
1770
+ at listenAdapter (dist/registry/index.js:77:28)
1771
+ at startPromise (dist/registry/index.js:143:35)
1772
+
1773
+ 4) registry
1774
+ "after all" hook in "registry":
1775
+ Error: done() invoked with non-Error: not opened
1776
+ at /Users/Ricardo.Agullo/Work/opencomponents/oc/packages/oc/dist/registry/index.js:123:13
1777
+
1778
+ 5) registry
1779
+ when fallbackRegistryUrl is specified
1780
+ "before all" hook in "when fallbackRegistryUrl is specified":
1781
+ Error: listen EADDRINUSE: address already in use :::3031
1782
+ at Server.setupListenHandle [as _listen2] (node:net:2008:16)
1783
+ at listenInCluster (node:net:2065:12)
1784
+ at Server.listen (node:net:2170:7)
1785
+ at /Users/Ricardo.Agullo/Work/opencomponents/oc/packages/oc/dist/registry/domain/http-server/express-adapter.js:149:26
1786
+ at new Promise (<anonymous>)
1787
+ at ExpressHttpServerAdapter.listen (dist/registry/domain/http-server/express-adapter.js:134:16)
1788
+ at listenAdapter (dist/registry/index.js:77:28)
1789
+ at startPromise (dist/registry/index.js:143:35)
1790
+ at process.processTicksAndRejections (node:internal/process/task_queues:104:5)
1791
+
1792
+ 6) registry
1793
+ when fallbackRegistryUrl is specified
1794
+ "after all" hook in "when fallbackRegistryUrl is specified":
1795
+ Error: done() invoked with non-Error: not opened
1796
+ at /Users/Ricardo.Agullo/Work/opencomponents/oc/packages/oc/dist/registry/index.js:123:13
1797
+
1798
+
1799
+
1800
+ npm error Lifecycle script `test` failed with error:
1801
+ npm error code 6
1802
+ npm error path /Users/Ricardo.Agullo/Work/opencomponents/oc/packages/oc
1803
+ npm error workspace oc@0.50.61
1804
+ npm error location /Users/Ricardo.Agullo/Work/opencomponents/oc/packages/oc
1805
+ npm error command failed
1806
+ npm error command sh -c node tasks/mochaTest.js