oc 0.50.48 → 0.50.50

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