oc 0.50.57 → 0.50.59

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