oc 0.50.55 → 0.50.56

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 (33) hide show
  1. package/.turbo/turbo-build.log +4 -4
  2. package/.turbo/turbo-test-silent.log +11 -11
  3. package/.turbo/turbo-test.log +6 -1614
  4. package/CHANGELOG.md +8 -0
  5. package/README.md +180 -0
  6. package/dist/cli/commands.d.ts +8 -0
  7. package/dist/cli/commands.js +8 -0
  8. package/dist/cli/facade/dev.d.ts +2 -2
  9. package/dist/cli/facade/registry-migrate-metadata.d.ts +20 -0
  10. package/dist/cli/facade/registry-migrate-metadata.js +105 -0
  11. package/dist/cli/index.js +2 -0
  12. package/dist/components/oc-client/_package/package.json +4 -4
  13. package/dist/components/oc-client/_package/server.js +1 -1
  14. package/dist/components/oc-client/package.json +1 -1
  15. package/dist/registry/domain/components-cache/index.d.ts +3 -1
  16. package/dist/registry/domain/components-cache/index.js +28 -5
  17. package/dist/registry/domain/components-details.d.ts +3 -1
  18. package/dist/registry/domain/components-details.js +26 -5
  19. package/dist/registry/domain/metadata-adapter-options.d.ts +6 -0
  20. package/dist/registry/domain/metadata-adapter-options.js +12 -0
  21. package/dist/registry/domain/metadata-index.d.ts +15 -0
  22. package/dist/registry/domain/metadata-index.js +132 -0
  23. package/dist/registry/domain/metadata-migration.d.ts +38 -0
  24. package/dist/registry/domain/metadata-migration.js +128 -0
  25. package/dist/registry/domain/repository.d.ts +1 -0
  26. package/dist/registry/domain/repository.js +106 -7
  27. package/dist/registry/domain/validators/registry-configuration.js +21 -0
  28. package/dist/registry/index.d.ts +1 -1
  29. package/dist/registry/index.js +6 -2
  30. package/dist/resources/index.d.ts +3 -0
  31. package/dist/resources/index.js +3 -0
  32. package/dist/types.d.ts +41 -1
  33. package/package.json +3 -2
@@ -1,1627 +1,19 @@
1
1
 
2
2
  
3
- > oc@0.50.52 test
3
+ > oc@0.50.55 test
4
4
  > npm run build && node tasks/mochaTest.js
5
5
 
6
6
 
7
- > oc@0.50.52 prebuild
7
+ > oc@0.50.55 prebuild
8
8
  > rimraf dist
9
9
 
10
10
  ⠙
11
- > oc@0.50.52 build
11
+ > oc@0.50.55 build
12
12
  > npm run lint && tsc && node tasks/build.js
13
13
 
14
14
  ⠙
15
- > oc@0.50.52 lint
15
+ > oc@0.50.55 lint
16
16
  > npx @biomejs/biome check preview src test tasks
17
17
 
18
- ⠙⠹⠸Checked 129 files in 40ms. 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:24225) [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
-  ✔ should cache the details after the first fetch
583
-  when details file does not exist on cdn
584
-  ✔ should return an error
585
-  refresh()
586
-  when details file exists on cdn
587
-  when details file is outdated on cdn
588
-  ✔ should fetch the component details for new components
589
-  when component details fetch fails
590
-  ✔ should return an error
591
-  ✔ should fire an error event
592
-  when component details fetch succeeds
593
-  ✔ should save the updated component details to file
594
-  when component details save fails
595
-  ✔ should return an error
596
-  ✔ should fire an error event
597
-  when component details save succeeds
598
-  ✔ should not error
599
-  ✔ should return result
600
-  ✔ should cache the refreshed details
601
-  when details file is up-to-date on cdn
602
-  ✔ should not error
603
-  ✔ should not save it
604
-  ✔ should return the result
605
-  when details file does not exist on cdn
606
-  ✔ should fetch the component details for new components
607
-  when component details fetch fails
608
-  ✔ should return an error
609
-  ✔ should fire an error event
610
-  when component details fetch succeeds
611
-  ✔ should save the updated component details to file
612
-  when component details save fails
613
-  ✔ should return an error
614
-  ✔ should fire an error event
615
-  when component details save succeeds
616
-  ✔ should not error
617
-  ✔ should return result
618
-  polling
619
-  ✔ should start the polling loop using the configured interval
620
-  ✔ should clear the previous loop when refreshing again
621
-  ✔ should restart the loop after each poll
622
-  ✔ should update the cache when the polled data is newer
623
-  ✔ should keep the cached data when the polled data is not newer
624
-  ✔ should fire an error event when polling fails
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 : routes : helpers : nested-renderer
647
-  when rendering nested component
648
-  when req is not valid
649
-  when componentName not valid
650
-  ✔ should throw an error
651
-  when componentName empty
652
-  ✔ should throw an error
653
-  when requesting a not existent component
654
-  ✔ should return an error in the callback
655
-  when req is valid
656
-  when all params specified
657
-  ✔ should get the html result
658
-  ✔ should make correct request to renderer
659
-  ✔ should get no error
660
-  when minimal params specified
661
-  ✔ should get the html result
662
-  ✔ should make correct request to renderer
663
-  ✔ should get no error
664
-  when rendering nested components
665
-  when req is not valid
666
-  when components not valid
667
-  ✔ should throw an error
668
-  when components empty
669
-  ✔ should throw an error
670
-  when requesting not existent components
671
-  ✔ should return no error in the callback
672
-  ✔ should return error in result callback
673
-  when req is valid
674
-  when all params specified
675
-  ✔ should get the html result
676
-  ✔ should make correct request to renderer
677
-  ✔ should get no error
678
-  when minimal params specified
679
-  ✔ should get the html result
680
-  ✔ should make correct request to renderer
681
-  ✔ should get no error
682
-
683
-  registry : domain : options-sanitiser
684
-  when options is empty
685
-  ✔ should set prefix to "/" (268ms)
686
-  ✔ should set tempDir to "./temp/" (96ms)
687
-  ✔ should set hotReloading to false (103ms)
688
-  ✔ should set verbosity to 0 (73ms)
689
-  ✔ should set customHeadersToSkipOnWeakVersion to [] (85ms)
690
-  ✔ should set timeout to 120000 (65ms)
691
-  when verbosity is provided
692
-  ✔ should leave value untouched (65ms)
693
-  customHeadersToSkipOnWeakVersion
694
-  when it contains valid elements
695
-  ✔ should convert the array elements to lower case (68ms)
696
-  fallbackRegistryUrl
697
-  when fallbackRegistryUrl doesn't contain / at the end of url
698
-  ✔ should add `/` at the end of url (62ms)
699
-  when fallbackRegistryUrl contains `/` at the end of url
700
-  ✔ should not modify fallbackRegistryUrl url (62ms)
701
-  prefix and baseUrl sanitization
702
-  ✔ should support various scenarios correctly (832ms)
703
-  when pollingInterval
704
-  is provided
705
-  ✔ should not modify it (58ms)
706
-  is not provided
707
-  ✔ should initialize it as 5000 (62ms)
708
-  when templates
709
-  is provided
710
-  ✔ should not modify it
711
-  is not provided
712
-  ✔ should initialize it as 5000 (56ms)
713
-  when env
714
-  is provided
715
-  ✔ should not modify it (57ms)
716
-  is not provided
717
-  ✔ should initialize it as an empty {} (56ms)
718
-  storage adapter configuration
719
-  when legacy "s3" param
720
-  is provided
721
-  ✔ should create a storage.adapter configuration accordingly (272ms)
722
-  when no storage adapter
723
-  is provided
724
-  ✔ should default to the oc-s3-storage-adapter (57ms)
725
-  when refreshInterval
726
-  is provided
727
-  ✔ should pass the refreshInterval to the storage options (66ms)
728
-  when verbosity
729
-  is provided
730
-  ✔ should pass the verbosity to the storage options (54ms)
731
-  when storage.path
732
-  does not include a protocol
733
-  ✔ should sanitize the path to rely on the https protocol (78ms)
734
-  does include a prefix
735
-  ✔ should not modify it (56ms)
736
-
737
-  registry : domain : plugins-initialiser
738
-  when initialising not valid plugins
739
-  when plugin not registered correctly
740
-  ✔ should error
741
-  when plugin is anonymous
742
-  ✔ should error
743
-  when plugin does not expose a register method
744
-  ✔ should error
745
-  when plugin does not expose an execute method
746
-  ✔ should error
747
-  when initialising valid plugins
748
-  ✔ should register plugin with passed options
749
-  ✔ should expose the functionalities using the plugin names
750
-  ✔ should expose descriptions on the plugin functions if defined
751
-  ✔ should be make the functionality usable
752
-  when plugin specifies dependencies
753
-  ✔ should provide the getValue register method with the required dependent plugins
754
-  when plugins have a circular dependency
755
-  ✔ should throw an error
756
-  when plugin depends on a plugin that is not registered
757
-  ✔ should throw an error
758
-  when plugin chain requires multiple passes
759
-  ✔ should defer the initalisation of the plugin until all dependencies have bee registered
760
-
761
-  registry : domain : register-templates
762
-  when templates get registered without additional templates
763
-  ✔ should correctly register core-templates
764
-  when templates get registered with additional templates
765
-  ✔ should correctly register core-templates & extra templates
766
-  ✔ should replace the devurl for the url field
767
-  and additional template is already part of core-templates
768
-  ✔ should correctly register core-templates only
769
-
770
-  registry : domain : repository
771
-  when on cdn configuration
772
-  when getting the list of available components
773
-  ✔ should fetch the list from the cache
774
-  ✔ should respond without an error
775
-  ✔ should list the components
776
-  when getting the components details
777
-  ✔ should not error
778
-  ✔ should return the result
779
-  when getting the list of supported templates
780
-  when no templates are specificed on the configuaration
781
-  ✔ should return core templates
782
-  when the templates specificed on the configuaration are core-templates
783
-  ✔ should only return uniques templates
784
-  when templates specificed on the configuaration are not installed
785
-  ✔ should throw an error
786
-  when trying to get a not valid component
787
-  when the component does not exist
788
-  ✔ should respond with a proper error
789
-  when the get component info fails
790
-  ✔ should respond with a proper error
791
-  when the component exists but version does not
792
-  ✔ should respond with a proper error
793
-  when getting an existing component
794
-  ✔ should respond without an error
795
-  ✔ should fetch the versions' list from the cache
796
-  ✔ should fetch the component info from the correct package.json file
797
-  ✔ should return the component info
798
-  when getting the .env file
799
-  ✔ should respond without an error
800
-  ✔ should return the component info
801
-  when getting a static file url
802
-  ✔ should be using the static redirector from registry
803
-  when publishing a component
804
-  when component has a not valid name
805
-  ✔ should respond with an error
806
-  when component has a not valid version
807
-  ✔ should respond with an error
808
-  when component has a valid name and version
809
-  when component with same name and version is already in library
810
-  ✔ should respond with an error
811
-  when is in check mode only
812
-  ✔ should not refresh cached components list
813
-  ✔ should not refresh componens details
814
-  ✔ should not publish components
815
-  when component with same name and version is not in library
816
-  ✔ should refresh cached components list
817
-  ✔ should refresh componens details
818
-  ✔ should store the component in the correct directory
819
-  when refreshing details is slow
820
-  ✔ should resolve publish before details refresh finishes
821
-  when on local configuration
822
-  when getting the list of available components
823
-  ✔ should respond without an error
824
-  ✔ should list the components
825
-  when trying to get a not valid component
826
-  when the component does not exist
827
-  ✔ should respond with a proper error
828
-  when the component exists but version does not
829
-  ✔ should respond with a proper error
830
-  when getting an existing component
831
-  ✔ should respond without an error
832
-  ✔ should return the component info
833
-  when getting a static file url
834
-  ✔ should be using the static redirector from registry
835
-  when trying to publish a component
836
-  ✔ should respond with an error
837
-
838
-  registry : domain : require-wrapper
839
-  when using the require wrapper in a clear context
840
-  when requiring a dependency
841
-  ✔ should correctly make the dependency require-able
842
-  when requiring an unrecognised dependency
843
-  ✔ should correctly throw an error
844
-  when requiring a core dependency
845
-  ✔ should correctly require and use the dependency
846
-  when requiring a core dependency with node: prefix
847
-  ✔ should correctly require and use the dependency
848
-  when requiring an unvetted core dependency
849
-  ✔ should correctly throw an error
850
-  when requiring a dependency with a relative path
851
-  ✔ should correctly make the dependency require-able
852
-  when requiring a dependency with a relative path that does not exist
853
-  ✔ should correctly throw an error
854
-  when try-require fails with absolute path but succeeds with package name
855
-  ✔ should fall back to requiring by package name
856
-  when a core module and npm package share the same name
857
-  ✔ should prefer the core module
858
-
859
-  registry : domain : sanitiser
860
-  when sanitising component's request parameters
861
-  when component has boolean parameter
862
-  ✔ should convert string to boolean when true
863
-  ✔ should convert string to boolean when true
864
-  when component has string parameter
865
-  ✔ should convert null to empty
866
-  when component has number parameter
867
-  ✔ should convert string to number
868
-  when component have not defined optional parameter
869
-  ✔ should keep the parameter as it is
870
-
871
-  registry : domain : adapter
872
-  when is not a legacy adapter
873
-  ✔ returns the same adapter
874
-  when is a legacy adapter
875
-  ✔ returns a universalified adapter
876
-  when is an official adapter
877
-  ✔ Shows a deprecation warning asking to upgrade
878
-  when is not an official adapter
879
-  ✔ Shows a deprecation warning about callbacks
880
-
881
-  registry : domain : url-builder
882
-  when building component url
883
-  when building component with just component name
884
-  ✔ should be baseUrl/componentName
885
-  when building component with version
886
-  ✔ should be baseUrl/componentName/version
887
-  when building component with query string parameters
888
-  when building component with number parameter
889
-  ✔ should be baseUrl/componentName/version/?param=123
890
-  when building component with url parameter
891
-  ✔ should be baseUrl/componentName/version/?param=encodedUrl
892
-  when building component preview url
893
-  when building url with just component name
894
-  ✔ should be baseUrl/componentName
895
-  when building url with version
896
-  ✔ should be baseUrl/componentName/version
897
-  when building url with query string parameters
898
-  when building component with number parameter
899
-  ✔ should be baseUrl/componentName/version/?param=123
900
-  when building component with url parameter
901
-  ✔ should be baseUrl/componentName/version/?param=encodedUrl
902
-
903
-  registry : domain : validator
904
-  when validating registry configuration
905
-  when configuration null
906
-  ✔ should not be valid
907
-  when configuration empty
908
-  ✔ should not be valid
909
-  prefix
910
-  when prefix does not start with /
911
-  ✔ should not be valid
912
-  when prefix does not end with /
913
-  ✔ should not be valid
914
-  publishAuth
915
-  when not specified
916
-  ✔ should be valid
917
-  when specified and not supported
918
-  ✔ should not be valid
919
-  when specified and basic
920
-  when username and password specified
921
-  ✔ should be valid
922
-  when multiple logins specified
923
-  when all logins have username and password
924
-  ✔ should be valid
925
-  when some logins are missing username or password
926
-  ✔ should not be valid
927
-  when logins array is empty
928
-  ✔ should not be valid
929
-  when username and password not specified
930
-  ✔ should not be valid
931
-  dependencies
932
-  when not specified
933
-  ✔ should be valid
934
-  when specified
935
-  when it is an array
936
-  ✔ should be valid
937
-  when it is not an array
938
-  ✔ should not be valid
939
-  s3
940
-  when local=true
941
-  ✔ should be valid
942
-  when not in local mode
943
-  when s3 settings empty
944
-  ✔ should not be valid
945
-  when s3 setting is missing bucket
946
-  ✔ should not be valid
947
-  when s3 setting is missing key
948
-  ✔ should not be valid
949
-  when s3 setting is missing region
950
-  ✔ should not be valid
951
-  when s3 setting is missing secret
952
-  ✔ should not be valid
953
-  when s3 setting do not use key/secret - EC2 IAM Role use case
954
-  ✔ should be valid
955
-  when s3 setting contains all properties
956
-  ✔ should be valid
957
-  routes
958
-  when not specified
959
-  ✔ should be valid
960
-  when specified
961
-  when not an array
962
-  ✔ should not be valid
963
-  when route does not contain route
964
-  ✔ should not be valid
965
-  when route does not contain handler
966
-  ✔ should not be valid
967
-  when route does not contain method
968
-  ✔ should not be valid
969
-  when route contains handler that is not a function or a string
970
-  ✔ should not be valid
971
-  when route overrides prefix namespace
972
-  ✔ should not be valid
973
-  customHeadersToSkipOnWeakVersion
974
-  when customHeadersToSkipOnWeakVersion is not an array
975
-  ✔ should not be valid
976
-  when customHeadersToSkipOnWeakVersion is an array but contains non-string elements
977
-  ✔ should not be valid
978
-  when customHeadersToSkipOnWeakVersion is a non-empty array of strings
979
-  ✔ should be valid
980
-  when validating component request by parameter
981
-  when component have not parameters
982
-  ✔ should be valid
983
-  when component have not mandatory parameters
984
-  ✔ should be valid when non mandatory parameters not provided
985
-  ✔ should be valid when non mandatory parameters provided in a valid format
986
-  ✔ should be not valid when non mandatory parameters provided in a non valid format
987
-  when component have mandatory parameters
988
-  ✔ should not be valid when mandatory parameter not provided
989
-  when mandatory string parameter provided
990
-  ✔ should be valid when parameter in a valid form
991
-  ✔ should not be valid when parameter in a non valid form
992
-  ✔ should be valid when parameter is an empty string
993
-  when non mandatory number provided
994
-  ✔ should not be valid when provided in a non valid form
995
-  ✔ should be valid when 0
996
-  when non mandatory boolean provided
997
-  ✔ should not be valid when provided in a non valid form
998
-  when mandatory number parameter provided
999
-  ✔ should be valid when parameter in a valid form
1000
-  ✔ should not be valid when parameter in a non valid form
1001
-  ✔ should not be valid when parameter is null
1002
-  when mandatory boolean parameter provided
1003
-  ✔ should be valid when parameter in a valid form
1004
-  ✔ should not be valid when parameter in a non valid form
1005
-  ✔ should not be valid when parameter is null
1006
-  ✔ should not be valid when parameter is undefined
1007
-  ✔ should not be valid when parameter not provided
1008
-  when component parameters have enum constraints
1009
-  when string parameter has enum constraint
1010
-  ✔ should be valid when parameter value is in enum
1011
-  ✔ should be valid when parameter value is another valid enum value
1012
-  ✔ should not be valid when parameter value is not in enum
1013
-  ✔ should not be valid when parameter value is case sensitive
1014
-  when number parameter has enum constraint
1015
-  ✔ should be valid when parameter value is in enum
1016
-  ✔ should be valid when parameter value is another valid enum value
1017
-  ✔ should not be valid when parameter value is not in enum
1018
-  ✔ should not be valid when parameter value is zero but not in enum
1019
-  when boolean parameter has enum constraint
1020
-  ✔ should be valid when parameter value is in enum
1021
-  ✔ should not be valid when parameter value is not in enum
1022
-  when parameter has both type and enum validation
1023
-  ✔ should not be valid when parameter has wrong type
1024
-  ✔ should not be valid when parameter has correct type but wrong enum value
1025
-  when multiple parameters have enum constraints
1026
-  ✔ should be valid when all parameters have valid enum values
1027
-  ✔ should not be valid when one parameter has invalid enum value
1028
-  ✔ should not be valid when multiple parameters have invalid enum values
1029
-  when parameter has empty enum array
1030
-  ✔ should not be valid when any value is provided
1031
-  when parameter has single value enum
1032
-  ✔ should be valid when parameter matches the single enum value
1033
-  ✔ should not be valid when parameter does not match the single enum value
1034
-  when validating component name for new candidate
1035
-  when name has spaces
1036
-  ✔ should not be valid
1037
-  when name has not allowed characters
1038
-  ✔ should not be valid
1039
-  when name has alphanumeric characters, _ or -
1040
-  ✔ should be valid
1041
-  when name is reserved
1042
-  ✔ should not be valid
1043
-  when validating component version for new candidate
1044
-  when version already exists
1045
-  ✔ should not be valid
1046
-  when version does not exist
1047
-  ✔ should be valid
1048
-  when validating component package for new candidate
1049
-  when package not valid
1050
-  ✔ should not be valid when uploaded files is empty
1051
-  ✔ should not be valid when uploaded package consists of multiple files
1052
-  ✔ should not be valid when file has not the proper file extension
1053
-  ✔ should not be valid when file has been truncated
1054
-  ✔ should not be valid when file has wrong mimetype
1055
-  when custom validation provided
1056
-  when package.json does not contain mandatory fields
1057
-  ✔ should not be valid
1058
-  ✔ should return the error
1059
-  when package.json contains mandatory fields
1060
-  ✔ should be valid
1061
-  when package is valid
1062
-  ✔ should be valid with mimetype application/octet-stream
1063
-  ✔ should be valid with mimetype application/gzip
1064
-  when validating component plugin requirements
1065
-  when component does not require any plugin
1066
-  ✔ should be valid
1067
-  when component requires plugin
1068
-  when registry does not support plugin
1069
-  ✔ should not be valid
1070
-  ✔ should list missing dependencies
1071
-  when registry supports plugin
1072
-  ✔ should be valid
1073
-  when validating CLI OC version in request headers
1074
-  when user-agent header is not specified
1075
-  ✔ should be invalid
1076
-  ✔ should suggest correct version of CLI
1077
-  when user-agent header doesn't have correct format
1078
-  ✔ should be invalid
1079
-  ✔ should suggest correct version of CLI
1080
-  when OC CLI version in user-agent header is lower than Registry version
1081
-  ✔ should be invalid
1082
-  ✔ should suggest correct version of CLI
1083
-  when OC CLI version in user-agent header is equal to Registry version (same major.minor)
1084
-  ✔ should be valid
1085
-  ✔ should not return an error
1086
-  when OC CLI version in user-agent header is higher than Registry version
1087
-  ✔ should be valid
1088
-  ✔ should not return an error
1089
-  when OC CLI version has different patch version but same major.minor
1090
-  ✔ should be valid
1091
-  ✔ should not return an error
1092
-  when validating node engine version in request headers
1093
-  when user-agent header is not specified
1094
-  ✔ should be invalid
1095
-  ✔ should suggest correct version of node engine
1096
-  when user-agent header doesn't have correct format
1097
-  ✔ should be invalid
1098
-  ✔ should suggest correct version of node engine
1099
-  when node version in user-agent header is lower than Registry version of node
1100
-  ✔ should be invalid
1101
-  ✔ should suggest correct version of node engine
1102
-  when node version in user-agent header is equal to Registry version of node
1103
-  ✔ should be valid
1104
-  ✔ should not return an error
1105
-  when node version in user-agent header is higher than Registry version of node
1106
-  ✔ should be valid
1107
-  ✔ should not return an error
1108
-
1109
-  registry : domain : version-handler
1110
-  when getting component
1111
-  when versions not available
1112
-  ✔ should return an undefined when a version is specified
1113
-  ✔ should return an undefined when a version is not specified
1114
-  when versions available
1115
-  ✔ should return the latest when a version is not specified
1116
-  ✔ should return undefined when not valid version specified
1117
-  ✔ should return the latest when latest version specified
1118
-  ✔ should return the latest minor+patch of a version when minor omitted
1119
-  ✔ should return the latest path for minor when patch omitted
1120
-  ✔ should return the latest patch of a version when ~ used on patch level
1121
-  ✔ should return the latest patch version when ~ used on minor level
1122
-  ✔ should return the latest patch of a version when X used on patch
1123
-  ✔ should return the latest patch of a version when X used on minor
1124
-  when only pre release versions available
1125
-  ✔ should return the latest when a version is not specified
1126
-  ✔ should return undefined when not valid version specified
1127
-  ✔ should return the latest when latest version specified
1128
-  ✔ should return the version specified
1129
-  when mix of release and pre-release versions available
1130
-  ✔ should return the latest release version when a version is not specified
1131
-  ✔ should return the latest when latest version specified
1132
-  ✔ should return the version specified
1133
-  when publishing component
1134
-  when version already exists
1135
-  ✔ shouldn't be valid
1136
-  when version is available
1137
-  ✔ should be valid when major than latest
1138
-  ✔ should be valid when major than latest minor of previous major
1139
-  ✔ should be valid when major than latest patch of previous minor
1140
-  ✔ should be valid when minor than an existing patch but not existing
1141
-
1142
-  registry : routes : component
1143
-  when getting a component with server.js execution timeout
1144
-  ✔ should return 500 status code
1145
-  ✔ should respond with error message
1146
-  ✔ should return component's name and request version
1147
-  when getting a component with a server.js that returns undefined data
1148
-  ✔ should return 500 status code
1149
-  ✔ should respond with error message for undefined data
1150
-  ✔ should return component's name and request version
1151
-  when getting a component with server.js execution errors
1152
-  ✔ should return 500 status code
1153
-  ✔ should respond with error message including missing plugin
1154
-  ✔ should return component's name and request version
1155
-  when getting a component with server.js asynchronous execution errors
1156
-  when has error that gets fired on first execution
1157
-  ✔ should return 500 status code
1158
-  ✔ should respond with error message for component execution error
1159
-  ✔ should return component's name and request version
1160
-  when has error that gets fired on following executions
1161
-  ✔ should return 200 status code for successful request
1162
-  ✔ should return 500 status code when error happens
1163
-  ✔ should respond without error for successful request
1164
-  ✔ should respond with error message for component execution error
1165
-  ✔ should return component's name and request version for both requests
1166
-  when getting a component that implements a plugin
1167
-  when plugin not declared in package.json
1168
- (node:24225) [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.)
1169
-  ✔ should return 500 status code
1170
-  ✔ should respond with GENERIC_ERROR error code
1171
-  ✔ should respond with error message including missing plugin
1172
-  ✔ should return component's name and request version
1173
-  when plugin declared in package.json
1174
-  when registry implements plugin
1175
-  ✔ should return 200 status code
1176
-  ✔ should use plugin inside compiledView
1177
-  ✔ should return component's name and request version
1178
-  when registry does not implement plugin
1179
-  ✔ should return 501 status code
1180
-  ✔ should respond with PLUGIN_MISSING_FROM_REGISTRY error code
1181
-  ✔ should respond with error message including missing plugin
1182
-  ✔ should return component's name and request version
1183
-  when getting a component that requires a npm module
1184
-  when registry implements dependency
1185
-  ✔ should return 200 status code
1186
-  ✔ should use plugin inside compiledView
1187
-  ✔ should return component's name and request version
1188
-  when registry does not implement dependency
1189
-  ✔ should return 501 status code
1190
-  ✔ should respond with DEPENDENCY_MISSING_FROM_REGISTRY error code
1191
-  ✔ should respond with error message including missing dependency
1192
-  ✔ should return component's name and request version
1193
-  when getting a component with server.js that sets custom headers with empty customHeadersToSkipOnWeakVersion
1194
-  ✔ should return 200 status code
1195
-  ✔ should set response headers
1196
-  ✔ should return component's name and request version
1197
-  when getting a component with server.js that sets custom headers with non-empty customHeadersToSkipOnWeakVersion
1198
-  ✔ should return 200 status code
1199
-  ✔ should not set response headers
1200
-  ✔ should return component's name and request version
1201
-  when getting a simple component with server.js after headers component no custom headers should be set
1202
-  ✔ should return 200 status code for the first component
1203
-  ✔ should return "response-headers-component" name for the first component's name and request version
1204
-  ✔ should set response headers for the first component
1205
-  ✔ should return 200 status code for the second component
1206
-  ✔ should return "simple-component" name for the second component's name and request version
1207
-  ✔ should not set custom response for the second component
1208
-  when getting a component info for a component that sets custom headers
1209
-  ✔ should return 200 status code
1210
-  ✔ should return no custom headers
1211
-  ✔ should return component's name and request version
1212
-  ✔ should not return rendered HTML
1213
-
1214
-  registry : routes : components
1215
-  when making valid request for two components
1216
-  ✔ should return 200 status code
1217
-  ✔ should return a response containing both components
1218
-  ✔ should return a response containing components in the correct order
1219
-  ✔ should return a response with error code and description for the first component
1220
-  ✔ should return a response with rendered html for second component
1221
-  ✔ should include 500 status code for first component
1222
-  ✔ should include 200 status code for second component
1223
-  ✔ should return name and request version for both components
1224
-  when making request for 0 components
1225
-  ✔ should return 200 status code
1226
-  ✔ should return a response containing empty array
1227
-  when making valid info request for two components
1228
-  ✔ should return 200 status code
1229
-  ✔ should return a response containing both components
1230
-  ✔ should return a response containing components in the correct order
1231
-  when making info request for 0 components
1232
-  ✔ should return 200 status code
1233
-  ✔ should return a response containing empty array
1234
-  when making not valid request
1235
-  when not providing components property
1236
-  ✔ should return 400 status code
1237
-  ✔ should return error details
1238
-  when components property is not an array
1239
-  ✔ should return 400 status code
1240
-  ✔ should return error details
1241
-  when component does not have name property
1242
-  ✔ should return 400 status code
1243
-  ✔ should return error details
1244
-  when components do not have name property
1245
-  ✔ should return 400 status code
1246
-  ✔ should return error details
1247
-  when getting a component that has custom parameters
1248
-  ✔ should return a 200 response
1249
-  when getting a component that has missing required parameters
1250
-  ✔ should return 400 status code
1251
-  when making valid info request for a component action
1252
-  ✔ should return a 200 response
1253
-
1254
-  registry : routes : plugins
1255
-  when is not discoverable
1256
-  ✔ should return 401 status code
1257
-  when is discoverable
1258
-  ✔ should return the list of dependencies
1259
-
1260
-  registry : routes : helpers : apply-default-values
1261
-  when component deesn't have optional parameters
1262
-  ✔ should return requestParameters
1263
-  when component has optional parameters
1264
-  when default value of parameter is not specified
1265
-  when request doesn't specify values of optional parameters
1266
-  ✔ should return requestParameters
1267
-  when default value of parameter is specified
1268
-  when request specify values of optional parameters
1269
-  ✔ should return requestParameters
1270
-  when request specify values of some optional parameters
1271
-  ✔ should return requestParameters
1272
-  when request doesn't specify values of optional parameters
1273
-  when string parameter is undefined
1274
-  ✔ should return requestParameters with default values of optional parameters
1275
-  when string parameter is null
1276
-  ✔ should return requestParameters with default values of optional parameters
1277
-
1278
-  registry : routes : helpers : get-available-dependencies
1279
-  happy path
1280
-  ✔ should map to structured view-model
1281
-
1282
-  registry : routes : helpers : get-component-fallback
1283
-  ✔ should not forward accept-encoding header when fetching from fallback registry
1284
-
1285
-  registry : routes : helpers : get-component
1286
-  when the component has an env file
1287
-  ✔ should put the env data as part of the context, available to the server
1288
-  when getting a component with success
1289
-  ✔ should fire a component-retrieved event
1290
-  when getting a component with failure
1291
-  ✔ should fire a data-provider-error event
1292
-  ✔ should fire a component-retrieved event
1293
-  when the component sends a custom status code
1294
-  ✔ should return that status code to the client
1295
-  when rendering a component with a legacy template
1296
-  when oc-client requests an unrendered component and it doesn't provide templates header
1297
-  ✔ should return the unrendered version
1298
-  when oc-client requests an unrendered component and it supports the correct template
1299
-  ✔ should return the unrendered version
1300
-  when rendering a component with a non legacy template
1301
-  when the registry supports the template
1302
-  when oc-client requests an unrendered component and the client doesn't support it
1303
-  ✔ should return the rendered version
1304
-  when oc-client requests an unrendered component and the client supports the correct template
1305
-  ✔ should return the unrendered version
1306
-  when the registry doesn't support the template
1307
-  when oc-client requests an unrendered component and the client doesn't support it
1308
-  ✔ should return an error
1309
-  when oc-client requests an unrendered component and the client supports the correct template
1310
-  ✔ should return an error
1311
-
1312
-  registry : routes : helpers : get-components-history
1313
-  when components details are provided
1314
-  composing the single history object
1315
-  ✔ should return the publish date of a component
1316
-  ✔ should return the version of a component
1317
-  ✔ should return the component name
1318
-  sorting the entries by date
1319
-  ✔ should return the publish date of a component
1320
-
1321
-  registry : routes : helpers : is-url-discoverable
1322
-  when url responds with application/json
1323
-  ✔ should not be discoverable
1324
-  when url responds with text/html
1325
-  ✔ should be discoverable
1326
-
1327
-  registry : routes : plugins
1328
-  when is not discoverable
1329
-  ✔ should return 401 status code
1330
-  when is discoverable
1331
-  ✔ should return the list of plugins
1332
-
1333
-  registry : routes : publish
1334
-  when publish finishes
1335
-  ✔ should remove only the uploaded package and extracted package folder
1336
-
1337
-  registry : routes : validate
1338
-  when packageJson is missing in body
1339
-  ✔ should return 400 status
1340
-  ✔ should return error message
1341
-  when component name and version are missing
1342
-  ✔ should return 400 status
1343
-  ✔ should return error message about missing name and version
1344
-  when component name is invalid
1345
-  ✔ should return 409 status
1346
-  ✔ should return error code and message
1347
-  when component version is invalid
1348
-  ✔ should return 409 status
1349
-  ✔ should return error code and message
1350
-  when validation is successful
1351
-  ✔ should return 200 status
1352
-  ✔ should return success message
1353
-  when using URL params for component name and version
1354
-  ✔ should return 200 status
1355
-  ✔ should return success message
1356
-
1357
-  registry
1358
-  when instanciated
1359
-  when options are not valid
1360
-  ✔ should throw an error
1361
-  when options are valid
1362
-  ✔ should instantiate express
1363
-  ✔ should bind the middleware
1364
-  ✔ should instanciate the repository
1365
-  when starting it
1366
-  when plugins initialiser fails
1367
-  ✔ should fail with error
1368
-  when plugins initialiser succeeds
1369
-  when repository initialisation fails
1370
-  ✔ should fail with error
1371
-  when repository initialisation succeeds
1372
-  when app fails to start
1373
-  ✔ should fail with error
1374
-  when app starts
1375
-  when http listener errors
1376
-  ✔ should fail with error
1377
-  when http listener succeeds
1378
-  ✔ should not return error
1379
-  ✔ should return the server instance
1380
-  ✔ should emit a start event
1381
-  when http listener emits an error before the listener to start
1382
-  ✔ should return error
1383
-  ✔ should emit an error event
1384
-
1385
-  resources : settings
1386
-  files to watch ignore regex
1387
-  when a legitimate file changes
1388
-  ✔ should not ignore it
1389
-  when a file in a github.io repo changes
1390
-  ✔ should not ignore it
1391
-  when something in the .git folder changes
1392
-  ✔ should ignore it
1393
-  when something in the .idea folder changes
1394
-  ✔ should ignore it
1395
-  when node_modules changes
1396
-  ✔ should ignore it
1397
-
1398
-  utils : dateStringify
1399
-  when the date is provided
1400
-  ✔ should return the correct stringified date
1401
-  when the provided data is not valid
1402
-  ✔ should return empty string
1403
-
1404
-  utils : npm-utils
1405
-  init()
1406
-  when invoked for path/to/component with silent=undefined
1407
-  ✔ should spawn the process with correct parameters
1408
-  ✔ should return no error
1409
-  ✔ should correctly setup on error and on close listeners
1410
-  when invoked for path/to/component with silent=true
1411
-  ✔ should spawn the process with correct parameters
1412
-  ✔ should return no error
1413
-  ✔ should correctly setup on error and on close listeners
1414
-  installDependency()
1415
-  when invoked for installing oc-template-jade-compiler
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
-  when invoked for installing lodash
1421
-  ✔ should spawn the process with correct parameters
1422
-  ✔ should return no error
1423
-  ✔ should return the installation path
1424
-  ✔ should correctly setup on error and on close listeners
1425
-  when invoked for installing underscore
1426
-  ✔ should spawn the process with correct parameters
1427
-  ✔ should return no error
1428
-  ✔ should return the installation path
1429
-  ✔ should correctly setup on error and on close listeners
1430
-  when invoked for installing oc-client@~1.2.3
1431
-  ✔ should spawn the process with correct parameters
1432
-  ✔ should return no error
1433
-  ✔ should return the installation path
1434
-  ✔ should correctly setup on error and on close listeners
1435
-  installDependencies()
1436
-  when invoked for installing [oc-template-jade-compiler, lodash]
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
-  when invoked for installing [moment, lodash]
1442
-  ✔ should spawn the process with correct parameters
1443
-  ✔ should return no error
1444
-  ✔ should return the installation path
1445
-  ✔ should correctly setup on error and on close listeners
1446
-  when invoked for installing [underscore, oc-client]
1447
-  ✔ should spawn the process with correct parameters
1448
-  ✔ should return no error
1449
-  ✔ should return the installation path
1450
-  ✔ should correctly setup on error and on close listeners
1451
-  when invoked for installing [oc-client@~1.2.3, oc-template-react-compiler]
1452
-  ✔ should spawn the process with correct parameters
1453
-  ✔ should return no error
1454
-  ✔ should return the installation path
1455
-  ✔ should correctly setup on error and on close listeners
1456
-
1457
-  utils : stripVersion
1458
-  when a non scoped dependency is provided
1459
-  when a version is included
1460
-  ✔ should return the dependency without the version
1461
-  when a version is not included
1462
-  ✔ should return the unmodified dependency
1463
-  when a scoped dependency is provided
1464
-  when a version is included
1465
-  ✔ should return the dependency without the version
1466
-  when a version is not included
1467
-  ✔ should return the unmodified dependency
1468
-
1469
-  registry (ui interface)
1470
-  GET / with Accept: text/html
1471
-  ✔ should not error
1472
-  ✔ should respond with html result
1473
-  GET /oc-client/~info with Accept: text/html
1474
-  ✔ should not error
1475
-  ✔ should respond with html result
1476
-  GET /welcome-with-optional-parameters/~info with Accept: text/html
1477
-  ✔ should not error
1478
-  ✔ should respond with html result
1479
-  ✔ should include parameter input fields
1480
-  ✔ should include parameter update JavaScript
1481
-
1482
-  registry
1483
-  when initialised with invalid configuration
1484
-  ✔ should throw an error
1485
-  GET /hello-world-custom-headers
1486
-  with the default configuration (no customHeadersToSkipOnWeakVersion defined) and strong version 1.0.0
1487
-  ✔ should return the component with custom headers
1488
-  with the default configuration (no customHeadersToSkipOnWeakVersion defined) and weak version 1.x.x
1489
-  ✔ should return the component with custom headers
1490
-  with a custom configuration with customHeadersToSkipOnWeakVersion defined
1491
-  when strong version is requested 1.0.0
1492
-  ✔ should return the component with the custom headers
1493
-  when weak version is requested 1.x.x
1494
-  ✔ should skip Cache-Control header
1495
-  GET /hello-world-custom-cookies
1496
-  with the default configuration and strong version 1.0.0
1497
-  ✔ should return the component and set cookies
1498
-  POST /hello-world-custom-headers
1499
-  with the default configuration (no customHeadersToSkipOnWeakVersion defined) and strong version 1.0.0
1500
-  ✔ should set HTTP custom headers
1501
-  ✔ should return the component with custom headers
1502
-  request with two components
1503
-  ✔ should not set HTTP custom headers
1504
-  with the default configuration (no customHeadersToSkipOnWeakVersion defined) and weak version 1.x.x
1505
-  ✔ should set HTTP custom headers
1506
-  ✔ should return the component with custom headers in the response body
1507
-  with a custom configuration with customHeadersToSkipOnWeakVersion defined
1508
-  when strong version is requested 1.0.0
1509
-  ✔ should set HTTP custom headers
1510
-  ✔ should return the component with the custom headers
1511
-  when weak version is requested 1.x.x
1512
-  ✔ should have HTTP custom headers
1513
-  ✔ should skip Cache-Control header
1514
-  POST /hello-world-custom-cookies
1515
-  with the default configuration and strong version 1.0.0
1516
-  ✔ should set HTTP cookies
1517
-  ✔ should return the component and keep headers in body the same
1518
-  GET /
1519
-  ✔ should respond with the correct href
1520
-  ✔ should list the components
1521
-  POST / (with circular-json)
1522
-  ✔ should respond with 500 status code
1523
-  ✔ should respond with rendering error
1524
-  GET /circular-json-error
1525
-  ✔ should respond with 500 status code
1526
-  ✔ should respond with rendering error
1527
-  GET /handlebars3-component
1528
-  ✔ should respond with 500 status code
1529
-  ✔ should respond with error for unsupported handlebars version
1530
-  GET /jade-filters
1531
-  ✔ should respond with 200 status code
1532
-  GET /hello-world
1533
-  when Accept header not specified
1534
-  ✔ should respond with the correct href
1535
-  ✔ should respond with requested version
1536
-  ✔ should respond with resolved version
1537
-  ✔ should respond with component name
1538
-  ✔ should respond with the rendered template
1539
-  ✔ should respond with render type = rendered
1540
-  when Accept header set to application/vnd.oc.unrendered+json
1541
-  ✔ should respond with the correct href
1542
-  ✔ should respond with requested version
1543
-  ✔ should respond with resolved version
1544
-  ✔ should respond with component name
1545
-  ✔ should respond with the un-rendered template
1546
-  ✔ should respond with proper render type
1547
-  GET /container-with-nested
1548
-  ✔ should respond with the correct href
1549
-  ✔ should respond with the rendered template including the nested rendered component
1550
-  ✔ should respond with proper render type
1551
-  GET /container-with-multiple-nested
1552
-  ✔ should respond with the correct href
1553
-  ✔ should respond with the rendered template including the nested rendered component
1554
-  ✔ should respond with proper render type
1555
-  GET /no-containers
1556
-  when Accept header not specified
1557
-  ✔ should respond with the correct href
1558
-  ✔ should respond with the rendered template without the outer container and without render info script
1559
-  ✔ should respond with proper render type
1560
-  GET /language
1561
-  when Accept-Language: en-US
1562
-  ✔ should respond with correct href
1563
-  ✔ should contain english language
1564
-  when Accept-Language: ja-JP
1565
-  ✔ should respond with correct href
1566
-  ✔ should contain japanese language
1567
-  when Accept-Language: ja-JP but __ocAcceptLanguage overrides with en-US (client-side failover)
1568
-  ✔ should respond with correct href
1569
-  ✔ should contain japanese language
1570
-  GET /lodash-component
1571
-  ✔ should respond with the correct href
1572
-  ✔ should respond correctly after using lodash server dependency
1573
-  GET /empty
1574
-  rendered
1575
-  ✔ should respond with the correct href
1576
-  ✔ should respond with an empty response
1577
-  unrendered
1578
-  ✔ should respond with the correct href
1579
-  ✔ should respond with a minimal empty view-model
1580
-  POST /
1581
-  when body is malformed
1582
-  ✔ should respond with 400 status code
1583
-  ✔ should respond with error
1584
-  when body contains multiple components
1585
-  when Accept header not specified
1586
-  ✔ should respond with two 200 status codes
1587
-  ✔ should respond with two rendered components
1588
-  when omitHref=true
1589
-  when getting rendered components
1590
-  ✔ should respond without href parameter
1591
-  when getting unrendered components
1592
-  ✔ should respond without href parameter
1593
-  when Accept header set to application/vnd.oc.unrendered+json
1594
-  ✔ should respond with two unrendered components
1595
-  when components require params
1596
-  when each component requires different params
1597
-  ✔ should render components with expected parameters
1598
-  when components require same parameters
1599
-  ✔ should render components with expected parameters
1600
-  when components have some common parameters and some different
1601
-  ✔ should render components with expected parameters
1602
-  when components have global parameters with local overrides
1603
-  ✔ should render components with expected parameters
1604
-  when components accept optional parameters
1605
-  ✔ should render first component with provided parameters
1606
-  ✔ should render second and third components with default value of nick
1607
-  ✔ should render fourth component without value of lastName
1608
-
1609
-  registry
1610
-  when fallbackRegistryUrl is specified
1611
-  GET /welcome
1612
-  ✔ should respond with the local registry url
1613
-  ✔ should respond the `Hello world!` html
1614
-  GET /fallback-hello-world
1615
-  ✔ should respond with the fallback registry url
1616
-  ✔ should respond the `Hello world!` html
1617
-  GET /fallback-hello-world/~info
1618
-  ✔ should respond with requested component
1619
-  ✔ should respond with components parameters
1620
-  GET /fallback-hello-world/~preview
1621
-  ✔ should respond with requested component
1622
-  ✔ should respond with components parameters
1623
-
1624
-
1625
-   848 passing (9s)
1626
-
1627
- ⠙
18
+ ⠙⠹⠸⠼Checked 133 files in 91ms. No fixes applied.
19
+ ⠙⠙