@ellipticltd/aml-utils 0.15.2 → 0.15.3
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.
- package/.idea/aml-utils.iml +12 -0
- package/.idea/inspectionProfiles/Project_Default.xml +6 -0
- package/.idea/modules.xml +8 -0
- package/.idea/vcs.xml +6 -0
- package/.nyc_output/62fbf615-4746-451c-aa0c-c12cb22b7a9d.json +1 -0
- package/.nyc_output/fd0c5a49-1dee-497a-bd75-dcf009fcab1e.json +1 -0
- package/.nyc_output/processinfo/1aa97f38-9e09-4229-9e02-5f7fa02f213b.json +1 -0
- package/.nyc_output/processinfo/62fbf615-4746-451c-aa0c-c12cb22b7a9d.json +1 -0
- package/.nyc_output/processinfo/b5dcfb1d-3f6e-47a0-89e4-e93e7bcc51d7.json +1 -0
- package/.nyc_output/processinfo/fd0c5a49-1dee-497a-bd75-dcf009fcab1e.json +1 -0
- package/.nyc_output/processinfo/index.json +1 -1
- package/coverage/errors/errors.js.html +1 -1
- package/coverage/errors/errors.spec.js.html +15 -15
- package/coverage/errors/index.html +12 -12
- package/coverage/file-parser/__tests/file-parser.spec.js.html +96 -96
- package/coverage/file-parser/__tests/index.html +32 -32
- package/coverage/file-parser/__tests/parse-row.spec.js.html +36 -36
- package/coverage/file-parser/__tests/sanitize-rows.spec.js.html +49 -49
- package/coverage/formatting/formatting.js.html +21 -21
- package/coverage/formatting/formatting.spec.js.html +30 -30
- package/coverage/formatting/index.html +28 -28
- package/coverage/index.html +54 -54
- package/coverage/middleware/index.html +1 -1
- package/coverage/middleware/middleware.js.html +1 -1
- package/coverage/orm-helpers/index.html +26 -26
- package/coverage/orm-helpers/ormHelpers.js.html +24 -24
- package/coverage/orm-helpers/ormHelpers.spec.js.html +9 -9
- package/coverage/types/index.html +1 -1
- package/coverage/types/types.js.html +1 -1
- package/coverage/validations/index.html +30 -30
- package/coverage/validations/validations.js.html +236 -545
- package/coverage/validations/validations.spec.js.html +159 -525
- package/dist/validations/validations.d.ts +6 -0
- package/dist/validations/validations.js +8 -0
- package/dist/validations/validations.spec.js +12 -0
- package/lib/validations/validations.js +8 -0
- package/lib/validations/validations.spec.js +13 -0
- package/package.json +1 -1
- package/.nyc_output/cd455ec6-4d73-4c5e-871e-7f0609bd11b8.json +0 -1
- package/.nyc_output/d6cd0f05-9810-4f97-8faa-8753f10b9d2d.json +0 -1
- package/.nyc_output/processinfo/3974a52e-3acc-45e4-a312-2dae8e2da051.json +0 -1
- package/.nyc_output/processinfo/3bbc21ec-7576-45f9-bc87-b6a79588c265.json +0 -1
- package/.nyc_output/processinfo/cd455ec6-4d73-4c5e-871e-7f0609bd11b8.json +0 -1
- package/.nyc_output/processinfo/d6cd0f05-9810-4f97-8faa-8753f10b9d2d.json +0 -1
- /package/.nyc_output/{3974a52e-3acc-45e4-a312-2dae8e2da051.json → 1aa97f38-9e09-4229-9e02-5f7fa02f213b.json} +0 -0
- /package/.nyc_output/{3bbc21ec-7576-45f9-bc87-b6a79588c265.json → b5dcfb1d-3f6e-47a0-89e4-e93e7bcc51d7.json} +0 -0
|
@@ -20,31 +20,31 @@
|
|
|
20
20
|
</h1>
|
|
21
21
|
<div class='clearfix'>
|
|
22
22
|
<div class='fl pad1y space-right2'>
|
|
23
|
-
<span class="strong">
|
|
23
|
+
<span class="strong">59.23% </span>
|
|
24
24
|
<span class="quiet">Statements</span>
|
|
25
|
-
<span class='fraction'>
|
|
25
|
+
<span class='fraction'>170/287</span>
|
|
26
26
|
</div>
|
|
27
27
|
<div class='fl pad1y space-right2'>
|
|
28
|
-
<span class="strong">
|
|
28
|
+
<span class="strong">0% </span>
|
|
29
29
|
<span class="quiet">Branches</span>
|
|
30
|
-
<span class='fraction'>
|
|
30
|
+
<span class='fraction'>0/24</span>
|
|
31
31
|
</div>
|
|
32
32
|
<div class='fl pad1y space-right2'>
|
|
33
|
-
<span class="strong">
|
|
33
|
+
<span class="strong">35.12% </span>
|
|
34
34
|
<span class="quiet">Functions</span>
|
|
35
|
-
<span class='fraction'>
|
|
35
|
+
<span class='fraction'>59/168</span>
|
|
36
36
|
</div>
|
|
37
37
|
<div class='fl pad1y space-right2'>
|
|
38
|
-
<span class="strong">
|
|
38
|
+
<span class="strong">87.63% </span>
|
|
39
39
|
<span class="quiet">Lines</span>
|
|
40
|
-
<span class='fraction'>
|
|
40
|
+
<span class='fraction'>170/194</span>
|
|
41
41
|
</div>
|
|
42
42
|
</div>
|
|
43
43
|
<p class="quiet">
|
|
44
44
|
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
|
|
45
45
|
</p>
|
|
46
46
|
</div>
|
|
47
|
-
<div class='status-line
|
|
47
|
+
<div class='status-line medium'></div>
|
|
48
48
|
<pre><table class="coverage">
|
|
49
49
|
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
|
|
50
50
|
<a name='L2'></a><a href='#L2'>2</a>
|
|
@@ -413,129 +413,7 @@
|
|
|
413
413
|
<a name='L365'></a><a href='#L365'>365</a>
|
|
414
414
|
<a name='L366'></a><a href='#L366'>366</a>
|
|
415
415
|
<a name='L367'></a><a href='#L367'>367</a>
|
|
416
|
-
<a name='L368'></a><a href='#L368'>368</a>
|
|
417
|
-
<a name='L369'></a><a href='#L369'>369</a>
|
|
418
|
-
<a name='L370'></a><a href='#L370'>370</a>
|
|
419
|
-
<a name='L371'></a><a href='#L371'>371</a>
|
|
420
|
-
<a name='L372'></a><a href='#L372'>372</a>
|
|
421
|
-
<a name='L373'></a><a href='#L373'>373</a>
|
|
422
|
-
<a name='L374'></a><a href='#L374'>374</a>
|
|
423
|
-
<a name='L375'></a><a href='#L375'>375</a>
|
|
424
|
-
<a name='L376'></a><a href='#L376'>376</a>
|
|
425
|
-
<a name='L377'></a><a href='#L377'>377</a>
|
|
426
|
-
<a name='L378'></a><a href='#L378'>378</a>
|
|
427
|
-
<a name='L379'></a><a href='#L379'>379</a>
|
|
428
|
-
<a name='L380'></a><a href='#L380'>380</a>
|
|
429
|
-
<a name='L381'></a><a href='#L381'>381</a>
|
|
430
|
-
<a name='L382'></a><a href='#L382'>382</a>
|
|
431
|
-
<a name='L383'></a><a href='#L383'>383</a>
|
|
432
|
-
<a name='L384'></a><a href='#L384'>384</a>
|
|
433
|
-
<a name='L385'></a><a href='#L385'>385</a>
|
|
434
|
-
<a name='L386'></a><a href='#L386'>386</a>
|
|
435
|
-
<a name='L387'></a><a href='#L387'>387</a>
|
|
436
|
-
<a name='L388'></a><a href='#L388'>388</a>
|
|
437
|
-
<a name='L389'></a><a href='#L389'>389</a>
|
|
438
|
-
<a name='L390'></a><a href='#L390'>390</a>
|
|
439
|
-
<a name='L391'></a><a href='#L391'>391</a>
|
|
440
|
-
<a name='L392'></a><a href='#L392'>392</a>
|
|
441
|
-
<a name='L393'></a><a href='#L393'>393</a>
|
|
442
|
-
<a name='L394'></a><a href='#L394'>394</a>
|
|
443
|
-
<a name='L395'></a><a href='#L395'>395</a>
|
|
444
|
-
<a name='L396'></a><a href='#L396'>396</a>
|
|
445
|
-
<a name='L397'></a><a href='#L397'>397</a>
|
|
446
|
-
<a name='L398'></a><a href='#L398'>398</a>
|
|
447
|
-
<a name='L399'></a><a href='#L399'>399</a>
|
|
448
|
-
<a name='L400'></a><a href='#L400'>400</a>
|
|
449
|
-
<a name='L401'></a><a href='#L401'>401</a>
|
|
450
|
-
<a name='L402'></a><a href='#L402'>402</a>
|
|
451
|
-
<a name='L403'></a><a href='#L403'>403</a>
|
|
452
|
-
<a name='L404'></a><a href='#L404'>404</a>
|
|
453
|
-
<a name='L405'></a><a href='#L405'>405</a>
|
|
454
|
-
<a name='L406'></a><a href='#L406'>406</a>
|
|
455
|
-
<a name='L407'></a><a href='#L407'>407</a>
|
|
456
|
-
<a name='L408'></a><a href='#L408'>408</a>
|
|
457
|
-
<a name='L409'></a><a href='#L409'>409</a>
|
|
458
|
-
<a name='L410'></a><a href='#L410'>410</a>
|
|
459
|
-
<a name='L411'></a><a href='#L411'>411</a>
|
|
460
|
-
<a name='L412'></a><a href='#L412'>412</a>
|
|
461
|
-
<a name='L413'></a><a href='#L413'>413</a>
|
|
462
|
-
<a name='L414'></a><a href='#L414'>414</a>
|
|
463
|
-
<a name='L415'></a><a href='#L415'>415</a>
|
|
464
|
-
<a name='L416'></a><a href='#L416'>416</a>
|
|
465
|
-
<a name='L417'></a><a href='#L417'>417</a>
|
|
466
|
-
<a name='L418'></a><a href='#L418'>418</a>
|
|
467
|
-
<a name='L419'></a><a href='#L419'>419</a>
|
|
468
|
-
<a name='L420'></a><a href='#L420'>420</a>
|
|
469
|
-
<a name='L421'></a><a href='#L421'>421</a>
|
|
470
|
-
<a name='L422'></a><a href='#L422'>422</a>
|
|
471
|
-
<a name='L423'></a><a href='#L423'>423</a>
|
|
472
|
-
<a name='L424'></a><a href='#L424'>424</a>
|
|
473
|
-
<a name='L425'></a><a href='#L425'>425</a>
|
|
474
|
-
<a name='L426'></a><a href='#L426'>426</a>
|
|
475
|
-
<a name='L427'></a><a href='#L427'>427</a>
|
|
476
|
-
<a name='L428'></a><a href='#L428'>428</a>
|
|
477
|
-
<a name='L429'></a><a href='#L429'>429</a>
|
|
478
|
-
<a name='L430'></a><a href='#L430'>430</a>
|
|
479
|
-
<a name='L431'></a><a href='#L431'>431</a>
|
|
480
|
-
<a name='L432'></a><a href='#L432'>432</a>
|
|
481
|
-
<a name='L433'></a><a href='#L433'>433</a>
|
|
482
|
-
<a name='L434'></a><a href='#L434'>434</a>
|
|
483
|
-
<a name='L435'></a><a href='#L435'>435</a>
|
|
484
|
-
<a name='L436'></a><a href='#L436'>436</a>
|
|
485
|
-
<a name='L437'></a><a href='#L437'>437</a>
|
|
486
|
-
<a name='L438'></a><a href='#L438'>438</a>
|
|
487
|
-
<a name='L439'></a><a href='#L439'>439</a>
|
|
488
|
-
<a name='L440'></a><a href='#L440'>440</a>
|
|
489
|
-
<a name='L441'></a><a href='#L441'>441</a>
|
|
490
|
-
<a name='L442'></a><a href='#L442'>442</a>
|
|
491
|
-
<a name='L443'></a><a href='#L443'>443</a>
|
|
492
|
-
<a name='L444'></a><a href='#L444'>444</a>
|
|
493
|
-
<a name='L445'></a><a href='#L445'>445</a>
|
|
494
|
-
<a name='L446'></a><a href='#L446'>446</a>
|
|
495
|
-
<a name='L447'></a><a href='#L447'>447</a>
|
|
496
|
-
<a name='L448'></a><a href='#L448'>448</a>
|
|
497
|
-
<a name='L449'></a><a href='#L449'>449</a>
|
|
498
|
-
<a name='L450'></a><a href='#L450'>450</a>
|
|
499
|
-
<a name='L451'></a><a href='#L451'>451</a>
|
|
500
|
-
<a name='L452'></a><a href='#L452'>452</a>
|
|
501
|
-
<a name='L453'></a><a href='#L453'>453</a>
|
|
502
|
-
<a name='L454'></a><a href='#L454'>454</a>
|
|
503
|
-
<a name='L455'></a><a href='#L455'>455</a>
|
|
504
|
-
<a name='L456'></a><a href='#L456'>456</a>
|
|
505
|
-
<a name='L457'></a><a href='#L457'>457</a>
|
|
506
|
-
<a name='L458'></a><a href='#L458'>458</a>
|
|
507
|
-
<a name='L459'></a><a href='#L459'>459</a>
|
|
508
|
-
<a name='L460'></a><a href='#L460'>460</a>
|
|
509
|
-
<a name='L461'></a><a href='#L461'>461</a>
|
|
510
|
-
<a name='L462'></a><a href='#L462'>462</a>
|
|
511
|
-
<a name='L463'></a><a href='#L463'>463</a>
|
|
512
|
-
<a name='L464'></a><a href='#L464'>464</a>
|
|
513
|
-
<a name='L465'></a><a href='#L465'>465</a>
|
|
514
|
-
<a name='L466'></a><a href='#L466'>466</a>
|
|
515
|
-
<a name='L467'></a><a href='#L467'>467</a>
|
|
516
|
-
<a name='L468'></a><a href='#L468'>468</a>
|
|
517
|
-
<a name='L469'></a><a href='#L469'>469</a>
|
|
518
|
-
<a name='L470'></a><a href='#L470'>470</a>
|
|
519
|
-
<a name='L471'></a><a href='#L471'>471</a>
|
|
520
|
-
<a name='L472'></a><a href='#L472'>472</a>
|
|
521
|
-
<a name='L473'></a><a href='#L473'>473</a>
|
|
522
|
-
<a name='L474'></a><a href='#L474'>474</a>
|
|
523
|
-
<a name='L475'></a><a href='#L475'>475</a>
|
|
524
|
-
<a name='L476'></a><a href='#L476'>476</a>
|
|
525
|
-
<a name='L477'></a><a href='#L477'>477</a>
|
|
526
|
-
<a name='L478'></a><a href='#L478'>478</a>
|
|
527
|
-
<a name='L479'></a><a href='#L479'>479</a>
|
|
528
|
-
<a name='L480'></a><a href='#L480'>480</a>
|
|
529
|
-
<a name='L481'></a><a href='#L481'>481</a>
|
|
530
|
-
<a name='L482'></a><a href='#L482'>482</a>
|
|
531
|
-
<a name='L483'></a><a href='#L483'>483</a>
|
|
532
|
-
<a name='L484'></a><a href='#L484'>484</a>
|
|
533
|
-
<a name='L485'></a><a href='#L485'>485</a>
|
|
534
|
-
<a name='L486'></a><a href='#L486'>486</a>
|
|
535
|
-
<a name='L487'></a><a href='#L487'>487</a>
|
|
536
|
-
<a name='L488'></a><a href='#L488'>488</a>
|
|
537
|
-
<a name='L489'></a><a href='#L489'>489</a>
|
|
538
|
-
<a name='L490'></a><a href='#L490'>490</a></td><td class="line-coverage quiet"><span class="cline-any cline-yes">1x</span>
|
|
416
|
+
<a name='L368'></a><a href='#L368'>368</a></td><td class="line-coverage quiet"><span class="cline-any cline-yes">1x</span>
|
|
539
417
|
<span class="cline-any cline-neutral"> </span>
|
|
540
418
|
<span class="cline-any cline-yes">1x</span>
|
|
541
419
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -573,12 +451,12 @@
|
|
|
573
451
|
<span class="cline-any cline-neutral"> </span>
|
|
574
452
|
<span class="cline-any cline-neutral"> </span>
|
|
575
453
|
<span class="cline-any cline-yes">1x</span>
|
|
576
|
-
<span class="cline-any cline-
|
|
454
|
+
<span class="cline-any cline-no"> </span>
|
|
577
455
|
<span class="cline-any cline-neutral"> </span>
|
|
578
456
|
<span class="cline-any cline-neutral"> </span>
|
|
579
457
|
<span class="cline-any cline-yes">1x</span>
|
|
580
|
-
<span class="cline-any cline-
|
|
581
|
-
<span class="cline-any cline-
|
|
458
|
+
<span class="cline-any cline-no"> </span>
|
|
459
|
+
<span class="cline-any cline-no"> </span>
|
|
582
460
|
<span class="cline-any cline-neutral"> </span>
|
|
583
461
|
<span class="cline-any cline-neutral"> </span>
|
|
584
462
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -587,8 +465,8 @@
|
|
|
587
465
|
<span class="cline-any cline-neutral"> </span>
|
|
588
466
|
<span class="cline-any cline-neutral"> </span>
|
|
589
467
|
<span class="cline-any cline-yes">1x</span>
|
|
590
|
-
<span class="cline-any cline-
|
|
591
|
-
<span class="cline-any cline-
|
|
468
|
+
<span class="cline-any cline-no"> </span>
|
|
469
|
+
<span class="cline-any cline-no"> </span>
|
|
592
470
|
<span class="cline-any cline-neutral"> </span>
|
|
593
471
|
<span class="cline-any cline-neutral"> </span>
|
|
594
472
|
<span class="cline-any cline-yes">1x</span>
|
|
@@ -610,26 +488,26 @@
|
|
|
610
488
|
<span class="cline-any cline-yes">1x</span>
|
|
611
489
|
<span class="cline-any cline-neutral"> </span>
|
|
612
490
|
<span class="cline-any cline-yes">1x</span>
|
|
613
|
-
<span class="cline-any cline-
|
|
491
|
+
<span class="cline-any cline-no"> </span>
|
|
614
492
|
<span class="cline-any cline-neutral"> </span>
|
|
615
493
|
<span class="cline-any cline-neutral"> </span>
|
|
616
494
|
<span class="cline-any cline-neutral"> </span>
|
|
617
495
|
<span class="cline-any cline-yes">1x</span>
|
|
618
496
|
<span class="cline-any cline-yes">1x</span>
|
|
619
|
-
<span class="cline-any cline-
|
|
497
|
+
<span class="cline-any cline-no"> </span>
|
|
620
498
|
<span class="cline-any cline-neutral"> </span>
|
|
621
499
|
<span class="cline-any cline-yes">1x</span>
|
|
622
|
-
<span class="cline-any cline-
|
|
500
|
+
<span class="cline-any cline-no"> </span>
|
|
623
501
|
<span class="cline-any cline-neutral"> </span>
|
|
624
502
|
<span class="cline-any cline-neutral"> </span>
|
|
625
503
|
<span class="cline-any cline-neutral"> </span>
|
|
626
504
|
<span class="cline-any cline-yes">1x</span>
|
|
627
505
|
<span class="cline-any cline-yes">1x</span>
|
|
628
|
-
<span class="cline-any cline-
|
|
506
|
+
<span class="cline-any cline-no"> </span>
|
|
629
507
|
<span class="cline-any cline-neutral"> </span>
|
|
630
508
|
<span class="cline-any cline-neutral"> </span>
|
|
631
509
|
<span class="cline-any cline-yes">1x</span>
|
|
632
|
-
<span class="cline-any cline-
|
|
510
|
+
<span class="cline-any cline-no"> </span>
|
|
633
511
|
<span class="cline-any cline-neutral"> </span>
|
|
634
512
|
<span class="cline-any cline-neutral"> </span>
|
|
635
513
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -637,11 +515,11 @@
|
|
|
637
515
|
<span class="cline-any cline-yes">1x</span>
|
|
638
516
|
<span class="cline-any cline-neutral"> </span>
|
|
639
517
|
<span class="cline-any cline-yes">1x</span>
|
|
640
|
-
<span class="cline-any cline-
|
|
518
|
+
<span class="cline-any cline-no"> </span>
|
|
641
519
|
<span class="cline-any cline-neutral"> </span>
|
|
642
520
|
<span class="cline-any cline-neutral"> </span>
|
|
643
521
|
<span class="cline-any cline-yes">1x</span>
|
|
644
|
-
<span class="cline-any cline-
|
|
522
|
+
<span class="cline-any cline-no"> </span>
|
|
645
523
|
<span class="cline-any cline-neutral"> </span>
|
|
646
524
|
<span class="cline-any cline-neutral"> </span>
|
|
647
525
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -649,37 +527,37 @@
|
|
|
649
527
|
<span class="cline-any cline-yes">1x</span>
|
|
650
528
|
<span class="cline-any cline-neutral"> </span>
|
|
651
529
|
<span class="cline-any cline-yes">1x</span>
|
|
652
|
-
<span class="cline-any cline-
|
|
530
|
+
<span class="cline-any cline-no"> </span>
|
|
653
531
|
<span class="cline-any cline-neutral"> </span>
|
|
654
532
|
<span class="cline-any cline-neutral"> </span>
|
|
655
533
|
<span class="cline-any cline-yes">1x</span>
|
|
656
|
-
<span class="cline-any cline-
|
|
534
|
+
<span class="cline-any cline-no"> </span>
|
|
657
535
|
<span class="cline-any cline-neutral"> </span>
|
|
658
536
|
<span class="cline-any cline-neutral"> </span>
|
|
659
537
|
<span class="cline-any cline-neutral"> </span>
|
|
660
538
|
<span class="cline-any cline-yes">1x</span>
|
|
661
539
|
<span class="cline-any cline-yes">1x</span>
|
|
662
|
-
<span class="cline-any cline-
|
|
663
|
-
<span class="cline-any cline-
|
|
540
|
+
<span class="cline-any cline-no"> </span>
|
|
541
|
+
<span class="cline-any cline-no"> </span>
|
|
664
542
|
<span class="cline-any cline-neutral"> </span>
|
|
665
543
|
<span class="cline-any cline-neutral"> </span>
|
|
666
544
|
<span class="cline-any cline-yes">1x</span>
|
|
667
|
-
<span class="cline-any cline-
|
|
668
|
-
<span class="cline-any cline-
|
|
669
|
-
<span class="cline-any cline-
|
|
545
|
+
<span class="cline-any cline-no"> </span>
|
|
546
|
+
<span class="cline-any cline-no"> </span>
|
|
547
|
+
<span class="cline-any cline-no"> </span>
|
|
670
548
|
<span class="cline-any cline-neutral"> </span>
|
|
671
549
|
<span class="cline-any cline-neutral"> </span>
|
|
672
550
|
<span class="cline-any cline-neutral"> </span>
|
|
673
551
|
<span class="cline-any cline-yes">1x</span>
|
|
674
552
|
<span class="cline-any cline-yes">1x</span>
|
|
675
|
-
<span class="cline-any cline-
|
|
676
|
-
<span class="cline-any cline-
|
|
553
|
+
<span class="cline-any cline-no"> </span>
|
|
554
|
+
<span class="cline-any cline-no"> </span>
|
|
677
555
|
<span class="cline-any cline-neutral"> </span>
|
|
678
556
|
<span class="cline-any cline-neutral"> </span>
|
|
679
557
|
<span class="cline-any cline-yes">1x</span>
|
|
680
|
-
<span class="cline-any cline-
|
|
681
|
-
<span class="cline-any cline-
|
|
682
|
-
<span class="cline-any cline-
|
|
558
|
+
<span class="cline-any cline-no"> </span>
|
|
559
|
+
<span class="cline-any cline-no"> </span>
|
|
560
|
+
<span class="cline-any cline-no"> </span>
|
|
683
561
|
<span class="cline-any cline-neutral"> </span>
|
|
684
562
|
<span class="cline-any cline-neutral"> </span>
|
|
685
563
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -812,24 +690,6 @@
|
|
|
812
690
|
<span class="cline-any cline-neutral"> </span>
|
|
813
691
|
<span class="cline-any cline-yes">1x</span>
|
|
814
692
|
<span class="cline-any cline-neutral"> </span>
|
|
815
|
-
<span class="cline-any cline-yes">1x</span>
|
|
816
|
-
<span class="cline-any cline-neutral"> </span>
|
|
817
|
-
<span class="cline-any cline-neutral"> </span>
|
|
818
|
-
<span class="cline-any cline-yes">1x</span>
|
|
819
|
-
<span class="cline-any cline-yes">1x</span>
|
|
820
|
-
<span class="cline-any cline-neutral"> </span>
|
|
821
|
-
<span class="cline-any cline-yes">1x</span>
|
|
822
|
-
<span class="cline-any cline-neutral"> </span>
|
|
823
|
-
<span class="cline-any cline-yes">1x</span>
|
|
824
|
-
<span class="cline-any cline-neutral"> </span>
|
|
825
|
-
<span class="cline-any cline-neutral"> </span>
|
|
826
|
-
<span class="cline-any cline-neutral"> </span>
|
|
827
|
-
<span class="cline-any cline-yes">1x</span>
|
|
828
|
-
<span class="cline-any cline-yes">1x</span>
|
|
829
|
-
<span class="cline-any cline-yes">1x</span>
|
|
830
|
-
<span class="cline-any cline-neutral"> </span>
|
|
831
|
-
<span class="cline-any cline-yes">1x</span>
|
|
832
|
-
<span class="cline-any cline-neutral"> </span>
|
|
833
693
|
<span class="cline-any cline-neutral"> </span>
|
|
834
694
|
<span class="cline-any cline-yes">1x</span>
|
|
835
695
|
<span class="cline-any cline-yes">1x</span>
|
|
@@ -920,110 +780,6 @@
|
|
|
920
780
|
<span class="cline-any cline-neutral"> </span>
|
|
921
781
|
<span class="cline-any cline-neutral"> </span>
|
|
922
782
|
<span class="cline-any cline-neutral"> </span>
|
|
923
|
-
<span class="cline-any cline-yes">1x</span>
|
|
924
|
-
<span class="cline-any cline-yes">1x</span>
|
|
925
|
-
<span class="cline-any cline-yes">1x</span>
|
|
926
|
-
<span class="cline-any cline-neutral"> </span>
|
|
927
|
-
<span class="cline-any cline-yes">1x</span>
|
|
928
|
-
<span class="cline-any cline-neutral"> </span>
|
|
929
|
-
<span class="cline-any cline-neutral"> </span>
|
|
930
|
-
<span class="cline-any cline-yes">1x</span>
|
|
931
|
-
<span class="cline-any cline-yes">1x</span>
|
|
932
|
-
<span class="cline-any cline-neutral"> </span>
|
|
933
|
-
<span class="cline-any cline-yes">1x</span>
|
|
934
|
-
<span class="cline-any cline-neutral"> </span>
|
|
935
|
-
<span class="cline-any cline-yes">1x</span>
|
|
936
|
-
<span class="cline-any cline-neutral"> </span>
|
|
937
|
-
<span class="cline-any cline-neutral"> </span>
|
|
938
|
-
<span class="cline-any cline-neutral"> </span>
|
|
939
|
-
<span class="cline-any cline-yes">1x</span>
|
|
940
|
-
<span class="cline-any cline-yes">1x</span>
|
|
941
|
-
<span class="cline-any cline-yes">1x</span>
|
|
942
|
-
<span class="cline-any cline-neutral"> </span>
|
|
943
|
-
<span class="cline-any cline-yes">1x</span>
|
|
944
|
-
<span class="cline-any cline-neutral"> </span>
|
|
945
|
-
<span class="cline-any cline-yes">1x</span>
|
|
946
|
-
<span class="cline-any cline-neutral"> </span>
|
|
947
|
-
<span class="cline-any cline-neutral"> </span>
|
|
948
|
-
<span class="cline-any cline-yes">1x</span>
|
|
949
|
-
<span class="cline-any cline-yes">1x</span>
|
|
950
|
-
<span class="cline-any cline-neutral"> </span>
|
|
951
|
-
<span class="cline-any cline-yes">1x</span>
|
|
952
|
-
<span class="cline-any cline-neutral"> </span>
|
|
953
|
-
<span class="cline-any cline-yes">1x</span>
|
|
954
|
-
<span class="cline-any cline-neutral"> </span>
|
|
955
|
-
<span class="cline-any cline-neutral"> </span>
|
|
956
|
-
<span class="cline-any cline-neutral"> </span>
|
|
957
|
-
<span class="cline-any cline-yes">1x</span>
|
|
958
|
-
<span class="cline-any cline-yes">1x</span>
|
|
959
|
-
<span class="cline-any cline-yes">1x</span>
|
|
960
|
-
<span class="cline-any cline-neutral"> </span>
|
|
961
|
-
<span class="cline-any cline-yes">1x</span>
|
|
962
|
-
<span class="cline-any cline-neutral"> </span>
|
|
963
|
-
<span class="cline-any cline-yes">1x</span>
|
|
964
|
-
<span class="cline-any cline-neutral"> </span>
|
|
965
|
-
<span class="cline-any cline-neutral"> </span>
|
|
966
|
-
<span class="cline-any cline-yes">1x</span>
|
|
967
|
-
<span class="cline-any cline-yes">1x</span>
|
|
968
|
-
<span class="cline-any cline-neutral"> </span>
|
|
969
|
-
<span class="cline-any cline-yes">1x</span>
|
|
970
|
-
<span class="cline-any cline-neutral"> </span>
|
|
971
|
-
<span class="cline-any cline-neutral"> </span>
|
|
972
|
-
<span class="cline-any cline-neutral"> </span>
|
|
973
|
-
<span class="cline-any cline-yes">1x</span>
|
|
974
|
-
<span class="cline-any cline-yes">1x</span>
|
|
975
|
-
<span class="cline-any cline-yes">1x</span>
|
|
976
|
-
<span class="cline-any cline-neutral"> </span>
|
|
977
|
-
<span class="cline-any cline-yes">1x</span>
|
|
978
|
-
<span class="cline-any cline-neutral"> </span>
|
|
979
|
-
<span class="cline-any cline-yes">1x</span>
|
|
980
|
-
<span class="cline-any cline-neutral"> </span>
|
|
981
|
-
<span class="cline-any cline-neutral"> </span>
|
|
982
|
-
<span class="cline-any cline-yes">1x</span>
|
|
983
|
-
<span class="cline-any cline-yes">1x</span>
|
|
984
|
-
<span class="cline-any cline-neutral"> </span>
|
|
985
|
-
<span class="cline-any cline-yes">1x</span>
|
|
986
|
-
<span class="cline-any cline-neutral"> </span>
|
|
987
|
-
<span class="cline-any cline-neutral"> </span>
|
|
988
|
-
<span class="cline-any cline-neutral"> </span>
|
|
989
|
-
<span class="cline-any cline-yes">1x</span>
|
|
990
|
-
<span class="cline-any cline-yes">1x</span>
|
|
991
|
-
<span class="cline-any cline-yes">1x</span>
|
|
992
|
-
<span class="cline-any cline-neutral"> </span>
|
|
993
|
-
<span class="cline-any cline-yes">1x</span>
|
|
994
|
-
<span class="cline-any cline-neutral"> </span>
|
|
995
|
-
<span class="cline-any cline-yes">1x</span>
|
|
996
|
-
<span class="cline-any cline-neutral"> </span>
|
|
997
|
-
<span class="cline-any cline-neutral"> </span>
|
|
998
|
-
<span class="cline-any cline-yes">1x</span>
|
|
999
|
-
<span class="cline-any cline-yes">1x</span>
|
|
1000
|
-
<span class="cline-any cline-neutral"> </span>
|
|
1001
|
-
<span class="cline-any cline-yes">1x</span>
|
|
1002
|
-
<span class="cline-any cline-neutral"> </span>
|
|
1003
|
-
<span class="cline-any cline-neutral"> </span>
|
|
1004
|
-
<span class="cline-any cline-neutral"> </span>
|
|
1005
|
-
<span class="cline-any cline-yes">1x</span>
|
|
1006
|
-
<span class="cline-any cline-yes">1x</span>
|
|
1007
|
-
<span class="cline-any cline-yes">1x</span>
|
|
1008
|
-
<span class="cline-any cline-neutral"> </span>
|
|
1009
|
-
<span class="cline-any cline-yes">1x</span>
|
|
1010
|
-
<span class="cline-any cline-neutral"> </span>
|
|
1011
|
-
<span class="cline-any cline-yes">1x</span>
|
|
1012
|
-
<span class="cline-any cline-neutral"> </span>
|
|
1013
|
-
<span class="cline-any cline-yes">1x</span>
|
|
1014
|
-
<span class="cline-any cline-neutral"> </span>
|
|
1015
|
-
<span class="cline-any cline-yes">1x</span>
|
|
1016
|
-
<span class="cline-any cline-neutral"> </span>
|
|
1017
|
-
<span class="cline-any cline-neutral"> </span>
|
|
1018
|
-
<span class="cline-any cline-yes">1x</span>
|
|
1019
|
-
<span class="cline-any cline-yes">1x</span>
|
|
1020
|
-
<span class="cline-any cline-neutral"> </span>
|
|
1021
|
-
<span class="cline-any cline-yes">1x</span>
|
|
1022
|
-
<span class="cline-any cline-neutral"> </span>
|
|
1023
|
-
<span class="cline-any cline-yes">1x</span>
|
|
1024
|
-
<span class="cline-any cline-neutral"> </span>
|
|
1025
|
-
<span class="cline-any cline-neutral"> </span>
|
|
1026
|
-
<span class="cline-any cline-neutral"> </span>
|
|
1027
783
|
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js">import validations from './validations';
|
|
1028
784
|
|
|
1029
785
|
const chai = require('chai');
|
|
@@ -1033,54 +789,54 @@ const { expect, assert } = chai;
|
|
|
1033
789
|
describe('Validations', () => {
|
|
1034
790
|
describe('global checks', () => {
|
|
1035
791
|
describe('exists', () => {
|
|
1036
|
-
it('should return true when passed any value', ()
|
|
792
|
+
it('should return true when passed any value', <span class="fstat-no" title="function not covered" >() =</span>> <span class="cstat-no" title="statement not covered" >validations.exists('x').should.be.true)</span>;
|
|
1037
793
|
|
|
1038
|
-
it('should return false when not passed a value', ()
|
|
794
|
+
it('should return false when not passed a value', <span class="fstat-no" title="function not covered" >() =</span>> <span class="cstat-no" title="statement not covered" >validations.exists().should.be.false)</span>;
|
|
1039
795
|
});
|
|
1040
796
|
|
|
1041
797
|
describe('nonEmpty', () => {
|
|
1042
|
-
it('should return true when passed any value with a length', ()
|
|
798
|
+
it('should return true when passed any value with a length', <span class="fstat-no" title="function not covered" >() =</span>> <span class="cstat-no" title="statement not covered" >validations.nonEmpty('x').should.be.true</span>
|
|
1043
799
|
&& validations.nonEmpty(['x']));
|
|
1044
800
|
|
|
1045
|
-
it('should return false when passed a value without a length', ()
|
|
801
|
+
it('should return false when passed a value without a length', <span class="fstat-no" title="function not covered" >() =</span>> <span class="cstat-no" title="statement not covered" >validations.nonEmpty().should.be.false</span>
|
|
1046
802
|
&& validations.nonEmpty({}).should.be.false
|
|
1047
803
|
&& validations.nonEmpty(null).should.be.false
|
|
1048
804
|
&& validations.nonEmpty(undefined).should.be.false);
|
|
1049
805
|
});
|
|
1050
806
|
|
|
1051
807
|
describe('isNonEmptyString', () => {
|
|
1052
|
-
it('should return true when passed a string of any length', ()
|
|
808
|
+
it('should return true when passed a string of any length', <span class="fstat-no" title="function not covered" >() =</span>> <span class="cstat-no" title="statement not covered" >validations.isNonEmptyString('x').should.be.true</span>
|
|
1053
809
|
&& validations.isNonEmptyString('Do not go gentle into that good night, Old age should burn and rage at close of day; Rage, rage against the dying of the light.').should.be.true);
|
|
1054
810
|
|
|
1055
|
-
it('should return false when passed an empty string or something that is not a string', ()
|
|
811
|
+
it('should return false when passed an empty string or something that is not a string', <span class="fstat-no" title="function not covered" >() =</span>> <span class="cstat-no" title="statement not covered" >validations.isNonEmptyString('').should.be.false</span>
|
|
1056
812
|
&& validations.isNonEmptyString(['x']).should.be.false
|
|
1057
813
|
&& validations.isNonEmptyString({ key: 'val' }).should.be.false);
|
|
1058
814
|
});
|
|
1059
815
|
|
|
1060
816
|
describe('ensureShortEnough', () => {
|
|
1061
|
-
it('should return true when the given string is shorter in length than the given length', ()
|
|
817
|
+
it('should return true when the given string is shorter in length than the given length', <span class="fstat-no" title="function not covered" >() =</span>> <span class="cstat-no" title="statement not covered" >validations.ensureShortEnough(3, 'foo').should.be.true</span>
|
|
1062
818
|
&& validations.ensureShortEnough(3, 'fo').should.be.true);
|
|
1063
819
|
|
|
1064
|
-
it('should throw a BadRequest error if the given string is longer than the given length', ()
|
|
1065
|
-
expect(()
|
|
820
|
+
it('should throw a BadRequest error if the given string is longer than the given length', <span class="fstat-no" title="function not covered" >() =</span>> {
|
|
821
|
+
<span class="cstat-no" title="statement not covered" > expect(<span class="fstat-no" title="function not covered" >() =</span>> <span class="cstat-no" title="statement not covered" >validations.ensureShortEnough(3, 'foo!'))</span>.to.throw('Max query size exceeded: 4 / 3');</span>
|
|
1066
822
|
});
|
|
1067
823
|
|
|
1068
|
-
it('should throw a BadRequest error if the given string is null or undefined', ()
|
|
1069
|
-
expect(()
|
|
1070
|
-
expect(()
|
|
824
|
+
it('should throw a BadRequest error if the given string is null or undefined', <span class="fstat-no" title="function not covered" >() =</span>> {
|
|
825
|
+
<span class="cstat-no" title="statement not covered" > expect(<span class="fstat-no" title="function not covered" >() =</span>> <span class="cstat-no" title="statement not covered" >validations.ensureShortEnough(3, null))</span>.to.throw('Max query size exceeded: undefined / 3');</span>
|
|
826
|
+
<span class="cstat-no" title="statement not covered" > expect(<span class="fstat-no" title="function not covered" >() =</span>> <span class="cstat-no" title="statement not covered" >validations.ensureShortEnough(3, undefined))</span>.to.throw('Max query size exceeded: undefined / 3');</span>
|
|
1071
827
|
});
|
|
1072
828
|
});
|
|
1073
829
|
|
|
1074
830
|
describe('ensure', () => {
|
|
1075
|
-
it('should return true if the first argument is not null or undefined', ()
|
|
831
|
+
it('should return true if the first argument is not null or undefined', <span class="fstat-no" title="function not covered" >() =</span>> <span class="cstat-no" title="statement not covered" >validations.ensure('thing', 'Error message').should.be.true</span>
|
|
1076
832
|
&& validations.ensure(['array'], 'Error message').should.be.true
|
|
1077
833
|
&& validations.ensure({ key: 'val' }).should.be.true);
|
|
1078
|
-
it('should throw a BadRequest error if the first argument is null or undefined', ()
|
|
1079
|
-
expect(<span class="fstat-no" title="function not covered" >() =</span>> <span class="cstat-no" title="statement not covered" >validations.ensure(null, 'Error message').to.throw('Error message'))</span
|
|
1080
|
-
expect(<span class="fstat-no" title="function not covered" >() =</span>> <span class="cstat-no" title="statement not covered" >validations.ensure(undefined, 'Error message').to.throw('Error message'))</span
|
|
834
|
+
it('should throw a BadRequest error if the first argument is null or undefined', <span class="fstat-no" title="function not covered" >() =</span>> {
|
|
835
|
+
<span class="cstat-no" title="statement not covered" > expect(<span class="fstat-no" title="function not covered" >() =</span>> <span class="cstat-no" title="statement not covered" >validations.ensure(null, 'Error message').to.throw('Error message'))</span>;</span>
|
|
836
|
+
<span class="cstat-no" title="statement not covered" > expect(<span class="fstat-no" title="function not covered" >() =</span>> <span class="cstat-no" title="statement not covered" >validations.ensure(undefined, 'Error message').to.throw('Error message'))</span>;</span>
|
|
1081
837
|
});
|
|
1082
838
|
});
|
|
1083
|
-
describe('isSafeString', () => {
|
|
839
|
+
describe.only('isSafeString', () => {
|
|
1084
840
|
it('should return true if the first argument is a safe string', () => {
|
|
1085
841
|
validations.isSafeString('aaaaa').should.be.true;
|
|
1086
842
|
validations.isSafeString('Customer reference').should.be.true;
|
|
@@ -1096,420 +852,298 @@ describe('Validations', () => {
|
|
|
1096
852
|
|
|
1097
853
|
describe('check', () => {
|
|
1098
854
|
describe('matches', () => {
|
|
1099
|
-
it('should return true when passed two arrays that exactly match', ()
|
|
855
|
+
it('should return true when passed two arrays that exactly match', <span class="fstat-no" title="function not covered" >() =</span>> <span class="cstat-no" title="statement not covered" >validations.check.matches([1, 2, 3, 4, 5], [1, 2, 3, 4, 5], 'error message').should.be.true)</span>;
|
|
1100
856
|
|
|
1101
|
-
it('should throw an error when passed two arrays that do not exactly match', ()
|
|
1102
|
-
expect(<span class="fstat-no" title="function not covered" >() =</span>> <span class="cstat-no" title="statement not covered" >validations.check.matches([1, 2, 3, 4], [1, 2, 3, 4, 5], 'Error message').to.throw('Error message'))</span
|
|
857
|
+
it('should throw an error when passed two arrays that do not exactly match', <span class="fstat-no" title="function not covered" >() =</span>> {
|
|
858
|
+
<span class="cstat-no" title="statement not covered" > expect(<span class="fstat-no" title="function not covered" >() =</span>> <span class="cstat-no" title="statement not covered" >validations.check.matches([1, 2, 3, 4], [1, 2, 3, 4, 5], 'Error message').to.throw('Error message'))</span>;</span>
|
|
1103
859
|
});
|
|
1104
860
|
});
|
|
1105
861
|
|
|
1106
862
|
describe('wasFound', () => {
|
|
1107
|
-
it('should return the string passed if this is not null', ()
|
|
1108
|
-
expect(validations.check.wasFound()('string')).to.equal('string')
|
|
863
|
+
it('should return the string passed if this is not null', <span class="fstat-no" title="function not covered" >() =</span>> {
|
|
864
|
+
<span class="cstat-no" title="statement not covered" > expect(validations.check.wasFound()('string')).to.equal('string');</span>
|
|
1109
865
|
});
|
|
1110
|
-
it('should throw an error if the item is null', ()
|
|
1111
|
-
expect(()
|
|
866
|
+
it('should throw an error if the item is null', <span class="fstat-no" title="function not covered" >() =</span>> {
|
|
867
|
+
<span class="cstat-no" title="statement not covered" > expect(<span class="fstat-no" title="function not covered" >() =</span>> <span class="cstat-no" title="statement not covered" >validations.check.wasFound('no value')())</span>.to.throw('Unknown no value');</span>
|
|
1112
868
|
});
|
|
1113
869
|
});
|
|
1114
870
|
|
|
1115
871
|
describe('wasCreated', () => {
|
|
1116
|
-
it('should return the array passed if it is not empty', ()
|
|
1117
|
-
expect(validations.check.wasCreated()([1, 2, 3])).to.eql([1, 2, 3])
|
|
872
|
+
it('should return the array passed if it is not empty', <span class="fstat-no" title="function not covered" >() =</span>> {
|
|
873
|
+
<span class="cstat-no" title="statement not covered" > expect(validations.check.wasCreated()([1, 2, 3])).to.eql([1, 2, 3]);</span>
|
|
1118
874
|
});
|
|
1119
875
|
|
|
1120
|
-
it('should throw an error if the array is empty', ()
|
|
1121
|
-
expect(()
|
|
876
|
+
it('should throw an error if the array is empty', <span class="fstat-no" title="function not covered" >() =</span>> {
|
|
877
|
+
<span class="cstat-no" title="statement not covered" > expect(<span class="fstat-no" title="function not covered" >() =</span>> <span class="cstat-no" title="statement not covered" >validations.check.wasCreated('Oh no! No array!')([]))</span>.to.throw('Oh no! No array!');</span>
|
|
1122
878
|
});
|
|
1123
879
|
});
|
|
1124
880
|
|
|
1125
881
|
describe('isTrue', () => {
|
|
1126
882
|
const count = 2;
|
|
1127
883
|
|
|
1128
|
-
it('should return true when the first arg is truthy', ()
|
|
1129
|
-
assert(validations.check.isTrue(count === 2, 'Count equals 2'), 'isTrue should be false')
|
|
884
|
+
it('should return true when the first arg is truthy', <span class="fstat-no" title="function not covered" >() =</span>> {
|
|
885
|
+
<span class="cstat-no" title="statement not covered" > assert(validations.check.isTrue(count === 2, 'Count equals 2'), 'isTrue should be false');</span>
|
|
1130
886
|
});
|
|
1131
887
|
|
|
1132
|
-
it('should throw an error when the first arg is falsy', ()
|
|
1133
|
-
expect(()
|
|
888
|
+
it('should throw an error when the first arg is falsy', <span class="fstat-no" title="function not covered" >() =</span>> {
|
|
889
|
+
<span class="cstat-no" title="statement not covered" > expect(<span class="fstat-no" title="function not covered" >() =</span>> <span class="cstat-no" title="statement not covered" >validations.check.isTrue(count <= 1, 'Count is greater than 1'))</span>.to.throw('Count is greater than 1');</span>
|
|
1134
890
|
});
|
|
1135
891
|
});
|
|
1136
892
|
|
|
1137
893
|
describe('isFalse', () => {
|
|
1138
894
|
const count = 2;
|
|
1139
895
|
|
|
1140
|
-
it('should return true when the first arg is falsy', ()
|
|
1141
|
-
assert(validations.check.isFalse(count === 3, 'Count should not equal 3'), 'isFalse should be true')
|
|
896
|
+
it('should return true when the first arg is falsy', <span class="fstat-no" title="function not covered" >() =</span>> {
|
|
897
|
+
<span class="cstat-no" title="statement not covered" > assert(validations.check.isFalse(count === 3, 'Count should not equal 3'), 'isFalse should be true');</span>
|
|
1142
898
|
});
|
|
1143
899
|
|
|
1144
|
-
it('should throw an error when the first arg is truthy', ()
|
|
1145
|
-
expect(()
|
|
900
|
+
it('should throw an error when the first arg is truthy', <span class="fstat-no" title="function not covered" >() =</span>> {
|
|
901
|
+
<span class="cstat-no" title="statement not covered" > expect(<span class="fstat-no" title="function not covered" >() =</span>> <span class="cstat-no" title="statement not covered" >validations.check.isFalse(count > 1, 'Count should be greater than 1'))</span>.to.throw('Count should be greater than 1');</span>
|
|
1146
902
|
});
|
|
1147
903
|
});
|
|
1148
904
|
|
|
1149
905
|
describe('isCustomerReference', () => {
|
|
1150
|
-
it('should return true if the string is longer than 0 and less than or equal to 100 characters', ()
|
|
1151
|
-
assert(validations.isCustomerReference('1'), 'isCustomerReference fails when the string length is 1')
|
|
1152
|
-
assert(validations.isCustomerReference('Spots of sunshine lie on the surface of the water dance, dance, and their reflections wobble.'), 'isCustomerReference fails when the string length is 100')
|
|
906
|
+
it('should return true if the string is longer than 0 and less than or equal to 100 characters', <span class="fstat-no" title="function not covered" >() =</span>> {
|
|
907
|
+
<span class="cstat-no" title="statement not covered" > assert(validations.isCustomerReference('1'), 'isCustomerReference fails when the string length is 1');</span>
|
|
908
|
+
<span class="cstat-no" title="statement not covered" > assert(validations.isCustomerReference('Spots of sunshine lie on the surface of the water dance, dance, and their reflections wobble.'), 'isCustomerReference fails when the string length is 100');</span>
|
|
1153
909
|
});
|
|
1154
910
|
|
|
1155
|
-
it('should return false when passed an empty string or one longer than 100 characters, or a non-string', ()
|
|
1156
|
-
assert(!validations.isCustomerReference(''), 'isCustomerReference passes when passed an empty string')
|
|
1157
|
-
assert(!validations.isCustomerReference('Little spots of sunshine lie on the surface of the water and dance, dance, and their reflections wobble deliciously over the ceiling;'), 'isCustomerReference passes with string over 100 characters')
|
|
1158
|
-
assert(!validations.isCustomerReference(['array']), 'isCustomerReference passes when passed a non-string')
|
|
911
|
+
it('should return false when passed an empty string or one longer than 100 characters, or a non-string', <span class="fstat-no" title="function not covered" >() =</span>> {
|
|
912
|
+
<span class="cstat-no" title="statement not covered" > assert(!validations.isCustomerReference(''), 'isCustomerReference passes when passed an empty string');</span>
|
|
913
|
+
<span class="cstat-no" title="statement not covered" > assert(!validations.isCustomerReference('Little spots of sunshine lie on the surface of the water and dance, dance, and their reflections wobble deliciously over the ceiling;'), 'isCustomerReference passes with string over 100 characters');</span>
|
|
914
|
+
<span class="cstat-no" title="statement not covered" > assert(!validations.isCustomerReference(['array']), 'isCustomerReference passes when passed a non-string');</span>
|
|
1159
915
|
});
|
|
1160
916
|
});
|
|
1161
917
|
|
|
1162
918
|
describe('isCustomerLabelName', () => {
|
|
1163
|
-
it('should return true if the string is longer than 0 and less than or equal to 50 characters', ()
|
|
1164
|
-
assert(validations.isCustomerLabelName('1'), 'isCustomerLabelName fails when the string length is 1')
|
|
1165
|
-
assert(validations.isCustomerLabelName('William Shakespeare was poet, playwright and actor'), 'isCustomerLabelName fails when the string length is 50')
|
|
919
|
+
it('should return true if the string is longer than 0 and less than or equal to 50 characters', <span class="fstat-no" title="function not covered" >() =</span>> {
|
|
920
|
+
<span class="cstat-no" title="statement not covered" > assert(validations.isCustomerLabelName('1'), 'isCustomerLabelName fails when the string length is 1');</span>
|
|
921
|
+
<span class="cstat-no" title="statement not covered" > assert(validations.isCustomerLabelName('William Shakespeare was poet, playwright and actor'), 'isCustomerLabelName fails when the string length is 50');</span>
|
|
1166
922
|
});
|
|
1167
923
|
|
|
1168
|
-
it('should return false when passed an empty string or one longer than 50 characters, or a non-string', ()
|
|
1169
|
-
assert(!validations.isCustomerLabelName(''), 'isCustomerLabelName passes when passed an empty string')
|
|
1170
|
-
assert(!validations.isCustomerLabelName("Many of Shakespeare's plays were published in editions of varying quality and accuracy in his lifetime."), 'isCustomerLabelName passes with string over 50 characters')
|
|
1171
|
-
assert(!validations.isCustomerLabelName(['array']), 'isCustomerLabelName passes when passed a non-string')
|
|
924
|
+
it('should return false when passed an empty string or one longer than 50 characters, or a non-string', <span class="fstat-no" title="function not covered" >() =</span>> {
|
|
925
|
+
<span class="cstat-no" title="statement not covered" > assert(!validations.isCustomerLabelName(''), 'isCustomerLabelName passes when passed an empty string');</span>
|
|
926
|
+
<span class="cstat-no" title="statement not covered" > assert(!validations.isCustomerLabelName("Many of Shakespeare's plays were published in editions of varying quality and accuracy in his lifetime."), 'isCustomerLabelName passes with string over 50 characters');</span>
|
|
927
|
+
<span class="cstat-no" title="statement not covered" > assert(!validations.isCustomerLabelName(['array']), 'isCustomerLabelName passes when passed a non-string');</span>
|
|
1172
928
|
});
|
|
1173
929
|
});
|
|
1174
930
|
});
|
|
1175
931
|
|
|
1176
932
|
describe('BCH', () => {
|
|
1177
933
|
describe('isAddress', () => {
|
|
1178
|
-
it('should correctly validate valid BCH addresses', ()
|
|
934
|
+
it('should correctly validate valid BCH addresses', <span class="fstat-no" title="function not covered" >() =</span>> <span class="cstat-no" title="statement not covered" >validations.bitcoinCash.isAddress('bitcoincash:qrrfmt57avxfd2476gqxqq54djtcvjuzjc2qtsrzcw').should.be.true</span>
|
|
1179
935
|
&& validations.bitcoinCash.isAddress('qqrxa0h9jqnc7v4wmj9ysetsp3y7w9l36u8gnnjulq').should.be.true);
|
|
1180
936
|
|
|
1181
|
-
it('should correctly validate an incorrect BCH address', ()
|
|
937
|
+
it('should correctly validate an incorrect BCH address', <span class="fstat-no" title="function not covered" >() =</span>> <span class="cstat-no" title="statement not covered" >validations.bitcoinCash.isAddress('qqrxa0h9jqnc7v4wmj3y7w9l36u8gnnjulq').should.be.false)</span>;
|
|
1182
938
|
});
|
|
1183
939
|
|
|
1184
940
|
describe('isTxHash', () => {
|
|
1185
|
-
it('should correctly validate a valid BCH hash', ()
|
|
941
|
+
it('should correctly validate a valid BCH hash', <span class="fstat-no" title="function not covered" >() =</span>> <span class="cstat-no" title="statement not covered" >validations.bitcoinCash.isTxHash('a32c4d2f9f2e322f19867dbacb7609a1be63c914b8f41775082b50d3ee1a0ce6').should.be.true)</span>;
|
|
1186
942
|
|
|
1187
|
-
it('should correctly validate an incorrect BCH hash', ()
|
|
943
|
+
it('should correctly validate an incorrect BCH hash', <span class="fstat-no" title="function not covered" >() =</span>> <span class="cstat-no" title="statement not covered" >validations.bitcoinCash.isTxHash('cd1bdc201022ca9386d8757b1c49ecc6ee3769cad2d42ab6e7f9e7bd831').should.be.false)</span>;
|
|
1188
944
|
|
|
1189
|
-
it('should return false when passed a non-hex string', ()
|
|
945
|
+
it('should return false when passed a non-hex string', <span class="fstat-no" title="function not covered" >() =</span>> <span class="cstat-no" title="statement not covered" >validations.bitcoinCash.isTxHash('Not a hex string!').should.be.false)</span>;
|
|
1190
946
|
});
|
|
1191
947
|
});
|
|
1192
948
|
|
|
1193
949
|
describe('BNB', () => {
|
|
1194
950
|
describe('isAddress', () => {
|
|
1195
|
-
it('should correctly validate valid BNB addresses', ()
|
|
951
|
+
it('should correctly validate valid BNB addresses', <span class="fstat-no" title="function not covered" >() =</span>> <span class="cstat-no" title="statement not covered" >validations.binanceCoin.isAddress('bnb1z35wusfv8twfele77vddclka9z84ugywug48gn').should.be.true)</span>;
|
|
1196
952
|
|
|
1197
|
-
it('should correctly validate an incorrect BNB address', ()
|
|
953
|
+
it('should correctly validate an incorrect BNB address', <span class="fstat-no" title="function not covered" >() =</span>> <span class="cstat-no" title="statement not covered" >validations.binanceCoin.isAddress('bnb1z35wusfv8twfele77vddclka9z84ugywug48gn1').should.be.false)</span>;
|
|
1198
954
|
});
|
|
1199
955
|
|
|
1200
956
|
describe('isTxHash', () => {
|
|
1201
|
-
it('should correctly validate a valid BNB hash', ()
|
|
957
|
+
it('should correctly validate a valid BNB hash', <span class="fstat-no" title="function not covered" >() =</span>> <span class="cstat-no" title="statement not covered" >validations.binanceCoin.isTxHash('E68C2D178F989DE296FA1B513D1AA138B234C436B52E0D755C6664A70F7EEF7B').should.be.true)</span>;
|
|
1202
958
|
|
|
1203
|
-
it('should correctly validate an incorrect BNB hash', ()
|
|
959
|
+
it('should correctly validate an incorrect BNB hash', <span class="fstat-no" title="function not covered" >() =</span>> <span class="cstat-no" title="statement not covered" >validations.binanceCoin.isTxHash('E68C2D178F989DE296FA1B513D1AA138B234C436B52E0D755C6664A70F7EEF7B1').should.be.false)</span>;
|
|
1204
960
|
|
|
1205
|
-
it('should return false when passed a non-hex string', ()
|
|
961
|
+
it('should return false when passed a non-hex string', <span class="fstat-no" title="function not covered" >() =</span>> <span class="cstat-no" title="statement not covered" >validations.binanceCoin.isTxHash('Not a hex string!').should.be.false)</span>;
|
|
1206
962
|
});
|
|
1207
963
|
});
|
|
1208
964
|
|
|
1209
965
|
describe('BTC', () => {
|
|
1210
966
|
describe('isAddress', () => {
|
|
1211
|
-
it('should correctly validate a valid BTC address', ()
|
|
967
|
+
it('should correctly validate a valid BTC address', <span class="fstat-no" title="function not covered" >() =</span>> <span class="cstat-no" title="statement not covered" >validations.bitcoin.isAddress('1LFnX5KT4CMKud7KB9xaXFZFkD3H8bUD16').should.be.true)</span>;
|
|
1212
968
|
|
|
1213
|
-
it('should correctly validate an incorrect BTC address', ()
|
|
969
|
+
it('should correctly validate an incorrect BTC address', <span class="fstat-no" title="function not covered" >() =</span>> <span class="cstat-no" title="statement not covered" >validations.bitcoin.isAddress('1LFnX5KT4CMKud7KB9xaXFZFkD3H8b').should.be.false)</span>;
|
|
1214
970
|
});
|
|
1215
971
|
|
|
1216
972
|
describe('isBech32Address', () => {
|
|
1217
|
-
it('should correctly validate a Bech32 address', ()
|
|
1218
|
-
it('should correctly validate an invalide Bech32 address', ()
|
|
973
|
+
it('should correctly validate a Bech32 address', <span class="fstat-no" title="function not covered" >() =</span>> <span class="cstat-no" title="statement not covered" >validations.bitcoin.isBech32Address('bc1qar0srrr7xfkvy5l643lydnw9re59gtzzwf5mdq').should.be.true)</span>;
|
|
974
|
+
it('should correctly validate an invalide Bech32 address', <span class="fstat-no" title="function not covered" >() =</span>> <span class="cstat-no" title="statement not covered" >validations.bitcoin.isBech32Address('4ef47f6eb681d5d9fa2f7e16336cd629303c635e8da51e425b76088be9c8744c').should.be.false)</span>;
|
|
1219
975
|
});
|
|
1220
976
|
|
|
1221
977
|
describe('isHDPublicKey', () => {
|
|
1222
|
-
it('should return true when passed an HD public key', ()
|
|
1223
|
-
it('should return false when not passed an HD public key', ()
|
|
978
|
+
it('should return true when passed an HD public key', <span class="fstat-no" title="function not covered" >() =</span>> <span class="cstat-no" title="statement not covered" >validations.bitcoin.isHDPublicKey('xprv9s21ZrQH143K3QTDL4LXw2F7HEK3wJUD2nW2nRk4stbPy6cq3jPPqjiChkVvvNKmPGJxWUtg6LnF5kejMRNNU3TGtRBeJgk33yuGBxrMPHi').should.be.true)</span>;
|
|
979
|
+
it('should return false when not passed an HD public key', <span class="fstat-no" title="function not covered" >() =</span>> <span class="cstat-no" title="statement not covered" >validations.bitcoin.isHDPublicKey('bc1qar0srrr7xfkvy5l643lydnw9re59gtzzwf5mdq').should.be.false)</span>;
|
|
1224
980
|
});
|
|
1225
981
|
|
|
1226
982
|
describe('isPublicKey', () => {
|
|
1227
|
-
it('should return true when passed a public key', ()
|
|
1228
|
-
it('should return false when not passed a public key', ()
|
|
983
|
+
it('should return true when passed a public key', <span class="fstat-no" title="function not covered" >() =</span>> <span class="cstat-no" title="statement not covered" >validations.bitcoin.isPublicKey('046c04c02f1138f440e8c5e9099db938bfba93d0389528bb7f6bf423ae203a2edcfba133f0409023d7ea13ac01c5aeedaf0bbfbeb8b82e9b48410d93a296da5b0c').should.be.true)</span>;
|
|
984
|
+
it('should return false when not passed a public key', <span class="fstat-no" title="function not covered" >() =</span>> <span class="cstat-no" title="statement not covered" >validations.bitcoin.isPublicKey('1EHNa6Q4Jz2uvNExL497mE43ikXhwF6kZm').should.be.false)</span>;
|
|
1229
985
|
});
|
|
1230
986
|
|
|
1231
987
|
describe('isTxHash', () => {
|
|
1232
|
-
it('should correctly validate a valid BTC hash', ()
|
|
1233
|
-
it('should correctly validate an incorrect BTC hash', ()
|
|
1234
|
-
it('should return false if the string passed is not a hex string', ()
|
|
988
|
+
it('should correctly validate a valid BTC hash', <span class="fstat-no" title="function not covered" >() =</span>> <span class="cstat-no" title="statement not covered" >validations.bitcoin.isTxHash('835346f3ea00a23df60ca5dc24afce67810c792ac4505e544410d4b19e7c95a0').should.be.true)</span>;
|
|
989
|
+
it('should correctly validate an incorrect BTC hash', <span class="fstat-no" title="function not covered" >() =</span>> <span class="cstat-no" title="statement not covered" >validations.bitcoin.isTxHash('835346f3ea00a23df60caafce67810c792ac4505e544410d4b19e7c95a0').should.be.false)</span>;
|
|
990
|
+
it('should return false if the string passed is not a hex string', <span class="fstat-no" title="function not covered" >() =</span>> <span class="cstat-no" title="statement not covered" >validations.bitcoin.isTxHex('Definitely not a hex string').should.be.false)</span>;
|
|
1235
991
|
});
|
|
1236
992
|
|
|
1237
993
|
describe('isTxHex', () => {
|
|
1238
994
|
const hex = '0100000002d8c8df6a6fdd2addaf589a83d860f18b44872d13ee6ec3526b2b470d42a96d4d000000008b483045022100b31557e47191936cb14e013fb421b1860b5e4fd5d2bc5ec1938f4ffb1651dc8902202661c2920771fd29dd91cd4100cefb971269836da4914d970d333861819265ba014104c54f8ea9507f31a05ae325616e3024bd9878cb0a5dff780444002d731577be4e2e69c663ff2da922902a4454841aa1754c1b6292ad7d317150308d8cce0ad7abffffffff2ab3fa4f68a512266134085d3260b94d3b6cfd351450cff021c045a69ba120b2000000008b4830450220230110bc99ef311f1f8bda9d0d968bfe5dfa4af171adbef9ef71678d658823bf022100f956d4fcfa0995a578d84e7e913f9bb1cf5b5be1440bcede07bce9cd5b38115d014104c6ec27cffce0823c3fecb162dbd576c88dd7cda0b7b32b0961188a392b488c94ca174d833ee6a9b71c0996620ae71e799fc7c77901db147fa7d97732e49c8226ffffffff02c0175302000000001976a914a3d89c53bb956f08917b44d113c6b2bcbe0c29b788acc01c3d09000000001976a91408338e1d5e26db3fce21b011795b1c3c8a5a5d0788ac00000000';
|
|
1239
|
-
it('should return true if passed a hex string Tx hash', ()
|
|
1240
|
-
it('should return false if the string passed is not a hex string', ()
|
|
1241
|
-
it('should return false if the string passed is a hex string, but is not a tx hash', ()
|
|
995
|
+
it('should return true if passed a hex string Tx hash', <span class="fstat-no" title="function not covered" >() =</span>> <span class="cstat-no" title="statement not covered" >validations.bitcoin.isTxHex(hex).should.be.true)</span>;
|
|
996
|
+
it('should return false if the string passed is not a hex string', <span class="fstat-no" title="function not covered" >() =</span>> <span class="cstat-no" title="statement not covered" >validations.bitcoin.isTxHex('definitelyNotAHexString').should.be.false)</span>;
|
|
997
|
+
it('should return false if the string passed is a hex string, but is not a tx hash', <span class="fstat-no" title="function not covered" >() =</span>> <span class="cstat-no" title="statement not covered" >validations.bitcoin.isTxHex('4ef47f6eb681d5d9fa2f7e16336cd629303c635e8da51e425b76088be9c8744c').should.be.false)</span>;
|
|
1242
998
|
});
|
|
1243
999
|
|
|
1244
1000
|
describe('isHDPath', () => {
|
|
1245
|
-
it('should return true when passed a valid HDPrivateKey path', ()
|
|
1246
|
-
it('should return false when passed a string that is not a valid HDPrivateKey path', ()
|
|
1001
|
+
it('should return true when passed a valid HDPrivateKey path', <span class="fstat-no" title="function not covered" >() =</span>> <span class="cstat-no" title="statement not covered" >validations.bitcoin.isHDPath('xprv9s21ZrQH143K3QTDL4LXw2F7HEK3wJUD2nW2nRk4stbPy6cq3jPPqjiChkVvvNKmPGJxWUtg6LnF5kejMRNNU3TGtRBeJgk33yuGBxrMPHi'))</span>;
|
|
1002
|
+
it('should return false when passed a string that is not a valid HDPrivateKey path', <span class="fstat-no" title="function not covered" >() =</span>> <span class="cstat-no" title="statement not covered" >validations.bitcoin.isHDPath('bc1qar0srrr7xfkvy5l643lydnw9re59gtzzwf5mdq').should.be.false)</span>;
|
|
1247
1003
|
});
|
|
1248
1004
|
|
|
1249
1005
|
describe('isScriptHex', () => {
|
|
1250
|
-
it('should return true when passed a script hex', ()
|
|
1251
|
-
it('should return false if the string passed is not a hex string', ()
|
|
1252
|
-
it('should return false if the string passed is a hex string, but is not a script hex', ()
|
|
1006
|
+
it('should return true when passed a script hex', <span class="fstat-no" title="function not covered" >() =</span>> <span class="cstat-no" title="statement not covered" >validations.bitcoin.isScriptHex('01000000011e2e8cfdf21d68f90974cd557a30c11894cc8cfec5cd5330e41846c2c84566bd000000006b4830450221009f61f453f44e807fdc538ca21710393d34005dd5709dabd8b6b9ccf09ea0b36a0220420d91a33f43d7b979471220e12cd1025975bd2e6c0bf2a14eb65ad89d578104012102de8f92034b9b3c956c1896d23a628537561e29faa772438aac2265c91ede6519ffffffff0118566202000000001976a914b27f04e510293c3e530e7b7bdf71f59118030e1e88ac00000000').should.be.true)</span>;
|
|
1007
|
+
it('should return false if the string passed is not a hex string', <span class="fstat-no" title="function not covered" >() =</span>> <span class="cstat-no" title="statement not covered" >validations.bitcoin.isScriptHex('definitelyNotAHexString').should.be.false)</span>;
|
|
1008
|
+
it('should return false if the string passed is a hex string, but is not a script hex', <span class="fstat-no" title="function not covered" >() =</span>> <span class="cstat-no" title="statement not covered" >validations.bitcoin.isScriptHex('mpXwg4jMtRhuSpVq4xS3HFHmCmWp9NyGKt').should.be.false)</span>;
|
|
1253
1009
|
});
|
|
1254
1010
|
|
|
1255
1011
|
describe('isTxSignature', () => {
|
|
1256
|
-
it('should return true when passed a tx hash that includes a signature', ()
|
|
1257
|
-
it('should return false when passed a tx hash that does not include a signature', ()
|
|
1258
|
-
it('should return false if the string passed is not a hex string', ()
|
|
1012
|
+
it('should return true when passed a tx hash that includes a signature', <span class="fstat-no" title="function not covered" >() =</span>> <span class="cstat-no" title="statement not covered" >validations.bitcoin.isTxSignature('304502206e21798a42fae0e854281abd38bacd1aeed3ee3738d9e1446618c4571d1090db022100e2ac980643b0b82c0e88ffdfec6b64e3e6ba35e7ba5fdd7d5d6cc8d25c6b241501').should.be.true)</span>;
|
|
1013
|
+
it('should return false when passed a tx hash that does not include a signature', <span class="fstat-no" title="function not covered" >() =</span>> <span class="cstat-no" title="statement not covered" >validations.bitcoin.isTxSignature('f5d8ee39a430901c91a5917b9f2dc19d6d1a0e9cea205b009ca73dd04470b9a6').should.be.false)</span>;
|
|
1014
|
+
it('should return false if the string passed is not a hex string', <span class="fstat-no" title="function not covered" >() =</span>> <span class="cstat-no" title="statement not covered" >validations.bitcoin.isTxSignature('definitelyNotAHexString').should.be.false)</span>;
|
|
1259
1015
|
});
|
|
1260
1016
|
|
|
1261
1017
|
describe('isBlockHeight', () => {
|
|
1262
|
-
it('should return true when passed a value greater than or equal to 0', ()
|
|
1018
|
+
it('should return true when passed a value greater than or equal to 0', <span class="fstat-no" title="function not covered" >() =</span>> <span class="cstat-no" title="statement not covered" >validations.bitcoin.isBlockHeight(986789).should.be.true</span>
|
|
1263
1019
|
&& validations.bitcoin.isBlockHeight('987654').should.be.true);
|
|
1264
|
-
it('should return false when passed a value that is not greater than or equal to 0', ()
|
|
1020
|
+
it('should return false when passed a value that is not greater than or equal to 0', <span class="fstat-no" title="function not covered" >() =</span>> <span class="cstat-no" title="statement not covered" >validations.bitcoin.isBlockHeight(null).should.be.false</span>
|
|
1265
1021
|
&& validations.bitcoin.isBlockHeight('string').should.be.false);
|
|
1266
1022
|
});
|
|
1267
1023
|
});
|
|
1268
1024
|
|
|
1269
1025
|
describe('ETH', () => {
|
|
1270
1026
|
describe('isAddress', () => {
|
|
1271
|
-
it('should return true if the address evaluates as a web3 address', ()
|
|
1272
|
-
it('should return false if the address does not evaluate to a web3 address', ()
|
|
1027
|
+
it('should return true if the address evaluates as a web3 address', <span class="fstat-no" title="function not covered" >() =</span>> <span class="cstat-no" title="statement not covered" >validations.ethereum.isAddress('0xa6Bc4b3fe7F2756124d30D896Fe4457711e9d214').should.be.true)</span>;
|
|
1028
|
+
it('should return false if the address does not evaluate to a web3 address', <span class="fstat-no" title="function not covered" >() =</span>> <span class="cstat-no" title="statement not covered" >validations.ethereum.isAddress('Bc4b3fe7F2756124d30D896Fe4457711e9d214').should.be.false)</span>;
|
|
1273
1029
|
});
|
|
1274
1030
|
|
|
1275
1031
|
describe('isBlockHash', () => {
|
|
1276
|
-
it('should return true when given a valid hash', ()
|
|
1277
|
-
it('should return false when given an vinalid hash', ()
|
|
1032
|
+
it('should return true when given a valid hash', <span class="fstat-no" title="function not covered" >() =</span>> <span class="cstat-no" title="statement not covered" >validations.ethereum.isBlockHash('0xec6491abd46a1a9a71b78f4b84d96fd49525aa4f66c8d8c3588c489f2f88eb0e').should.be.true)</span>;
|
|
1033
|
+
it('should return false when given an vinalid hash', <span class="fstat-no" title="function not covered" >() =</span>> <span class="cstat-no" title="statement not covered" >validations.ethereum.isBlockHash('0xec6491abd46a1a9a71b78f4b84d96fd49525aa4f66c8d8c3588c489eb0e').should.be.false)</span>;
|
|
1278
1034
|
});
|
|
1279
1035
|
|
|
1280
1036
|
describe('isTxHash', () => {
|
|
1281
|
-
it('should correctly validate a valid ETH hash', ()
|
|
1037
|
+
it('should correctly validate a valid ETH hash', <span class="fstat-no" title="function not covered" >() =</span>> <span class="cstat-no" title="statement not covered" >validations.ethereum.isTxHash('0xec6491abd46a1a9a71b78f4b84d96fd49525aa4f66c8d8c3588c489f2f88eb0e').should.be.true)</span>;
|
|
1282
1038
|
|
|
1283
|
-
it('should correctly validate an incorrect ETH hash', ()
|
|
1039
|
+
it('should correctly validate an incorrect ETH hash', <span class="fstat-no" title="function not covered" >() =</span>> <span class="cstat-no" title="statement not covered" >validations.ethereum.isTxHash('0xec6491abd46a1a9a71b7896fd49525aa4f66c8d8c3588c489f2f88eb0e').should.be.false)</span>;
|
|
1284
1040
|
});
|
|
1285
1041
|
|
|
1286
1042
|
describe('isAddressCode', () => {
|
|
1287
|
-
it('should return true if the string is a hex address', ()
|
|
1288
|
-
it('should return false if the string is not a hex address', ()
|
|
1043
|
+
it('should return true if the string is a hex address', <span class="fstat-no" title="function not covered" >() =</span>> <span class="cstat-no" title="statement not covered" >validations.ethereum.isAddressCode('0xa6Bc4b3fe7F2756124d30D896Fe4457711e9d214').should.be.true)</span>;
|
|
1044
|
+
it('should return false if the string is not a hex address', <span class="fstat-no" title="function not covered" >() =</span>> <span class="cstat-no" title="statement not covered" >validations.ethereum.isAddressCode('0xa6Bc4b3fe7F27yu124d30D896Fe4457711e9d214').should.be.false)</span>;
|
|
1289
1045
|
});
|
|
1290
1046
|
|
|
1291
1047
|
describe('isValidWeiAmount', () => {
|
|
1292
|
-
it('should return true when passed an amount that evaluates to wei', ()
|
|
1293
|
-
it('should return false when passed an amount that is not valid in wei', ()
|
|
1048
|
+
it('should return true when passed an amount that evaluates to wei', <span class="fstat-no" title="function not covered" >() =</span>> <span class="cstat-no" title="statement not covered" >validations.ethereum.isValidWeiAmount('7000000000000000').should.be.true)</span>;
|
|
1049
|
+
it('should return false when passed an amount that is not valid in wei', <span class="fstat-no" title="function not covered" >() =</span>> <span class="cstat-no" title="statement not covered" >validations.ethereum.isValidWeiAmount(7000000000000000).should.be.false</span>
|
|
1294
1050
|
&& validations.ethereum.isValidWeiAmount('1000.00').should.be.false);
|
|
1295
1051
|
});
|
|
1296
1052
|
});
|
|
1297
1053
|
|
|
1298
1054
|
describe('LTC', () => {
|
|
1299
1055
|
describe('isAddress', () => {
|
|
1300
|
-
it('should correctly validate valid LTC addresses', ()
|
|
1056
|
+
it('should correctly validate valid LTC addresses', <span class="fstat-no" title="function not covered" >() =</span>> <span class="cstat-no" title="statement not covered" >validations.litecoin.isAddress('LMR7przNNMS3GpaD6Ygq64NxbsJsZAqGgM').should.be.true)</span>;
|
|
1301
1057
|
|
|
1302
|
-
it('should correctly validate
|
|
1303
|
-
|
|
1304
|
-
it('should correctly validate an incorrect LTC address', () => validations.litecoin.isAddress('t1t8BzkNb8d98o8kpbwrjtUjMX3GMF').should.be.false);
|
|
1058
|
+
it('should correctly validate an incorrect LTC address', <span class="fstat-no" title="function not covered" >() =</span>> <span class="cstat-no" title="statement not covered" >validations.litecoin.isAddress('t1t8BzkNb8d98o8kpbwrjtUjMX3GMF').should.be.false)</span>;
|
|
1305
1059
|
});
|
|
1306
1060
|
|
|
1307
1061
|
describe('isTxHash', () => {
|
|
1308
|
-
it('should correctly validate a valid LTC hash', ()
|
|
1062
|
+
it('should correctly validate a valid LTC hash', <span class="fstat-no" title="function not covered" >() =</span>> <span class="cstat-no" title="statement not covered" >validations.litecoin.isTxHash('b0b858b34675cc8f851e6a2174295ada574837422538efe9ca83ef405d2faf29').should.be.true)</span>;
|
|
1309
1063
|
|
|
1310
|
-
it('should correctly validate an incorrect LTC hash', ()
|
|
1064
|
+
it('should correctly validate an incorrect LTC hash', <span class="fstat-no" title="function not covered" >() =</span>> <span class="cstat-no" title="statement not covered" >validations.litecoin.isTxHash('b0b858b34675cc8f851e6a2295ada574837422538efe9ca83ef405d2faf29').should.be.false)</span>;
|
|
1311
1065
|
|
|
1312
|
-
it('should return false when passed a non-hex string', ()
|
|
1066
|
+
it('should return false when passed a non-hex string', <span class="fstat-no" title="function not covered" >() =</span>> <span class="cstat-no" title="statement not covered" >validations.litecoin.isTxHash('Not a hex code here').should.be.false)</span>;
|
|
1313
1067
|
});
|
|
1314
1068
|
});
|
|
1315
1069
|
|
|
1316
1070
|
describe('XLM', () => {
|
|
1317
1071
|
describe('isAddress', () => {
|
|
1318
|
-
it('should correctly validate valid XLM addresses', ()
|
|
1072
|
+
it('should correctly validate valid XLM addresses', <span class="fstat-no" title="function not covered" >() =</span>> <span class="cstat-no" title="statement not covered" >validations.stellar.isAddress('GBH4TZYZ4IRCPO44CBOLFUHULU2WGALXTAVESQA6432MBJMABBB4GIYI').should.be.true)</span>;
|
|
1319
1073
|
|
|
1320
|
-
it('should correctly validate an incorrect XLM address', ()
|
|
1074
|
+
it('should correctly validate an incorrect XLM address', <span class="fstat-no" title="function not covered" >() =</span>> <span class="cstat-no" title="statement not covered" >validations.stellar.isAddress('GBH4TZYZ4IRCPO44CAAAAAAULU2WGALXTAVESQA6432MBJMABBB4GIYI').should.be.false)</span>;
|
|
1321
1075
|
});
|
|
1322
1076
|
|
|
1323
1077
|
describe('isTxHash', () => {
|
|
1324
|
-
it('should correctly validate a valid XLM hash', ()
|
|
1078
|
+
it('should correctly validate a valid XLM hash', <span class="fstat-no" title="function not covered" >() =</span>> <span class="cstat-no" title="statement not covered" >validations.stellar.isTxHash('dcf208070966a0f04dbff0be6abe5bc7ea2d77f16167e89e1869a8efc68ebe44').should.be.true)</span>;
|
|
1325
1079
|
|
|
1326
|
-
it('should correctly validate an incorrect XLM hash', ()
|
|
1080
|
+
it('should correctly validate an incorrect XLM hash', <span class="fstat-no" title="function not covered" >() =</span>> <span class="cstat-no" title="statement not covered" >validations.stellar.isTxHash('8ee1f64137b12d07f8d2ddd3460d78ecbe37ba671aa4e54af34de935cc2bba2ca').should.be.false)</span>;
|
|
1327
1081
|
|
|
1328
|
-
it('should return false when passed a non-hex string', ()
|
|
1082
|
+
it('should return false when passed a non-hex string', <span class="fstat-no" title="function not covered" >() =</span>> <span class="cstat-no" title="statement not covered" >validations.stellar.isTxHash('Yet again this is not a hex string').should.be.false)</span>;
|
|
1329
1083
|
});
|
|
1330
1084
|
});
|
|
1331
1085
|
|
|
1332
1086
|
describe('XRP', () => {
|
|
1333
1087
|
describe('isAddress', () => {
|
|
1334
|
-
it('should correctly validate valid XRP addresses', ()
|
|
1088
|
+
it('should correctly validate valid XRP addresses', <span class="fstat-no" title="function not covered" >() =</span>> <span class="cstat-no" title="statement not covered" >validations.ripple.isAddress('rDV3RhpWznRCmtpD17RNxg6t4Hg8NPV8mF').should.be.true)</span>;
|
|
1335
1089
|
|
|
1336
|
-
it('should correctly validate an incorrect XRP address', ()
|
|
1090
|
+
it('should correctly validate an incorrect XRP address', <span class="fstat-no" title="function not covered" >() =</span>> <span class="cstat-no" title="statement not covered" >validations.ripple.isAddress('rDV3RhpWznRCmtpD17RNxg0t4Hg8NPV8mF').should.be.false)</span>;
|
|
1337
1091
|
});
|
|
1338
1092
|
|
|
1339
1093
|
describe('isTxHash', () => {
|
|
1340
|
-
it('should correctly validate a valid XRP hash', ()
|
|
1094
|
+
it('should correctly validate a valid XRP hash', <span class="fstat-no" title="function not covered" >() =</span>> <span class="cstat-no" title="statement not covered" >validations.ripple.isTxHash('C6593DD2A32ED5120DF1FE80665B84A9CCAF06ADDC2EF89F720CBAC3E8069C0E').should.be.true)</span>;
|
|
1341
1095
|
|
|
1342
|
-
it('should correctly validate an incorrect XRP hash', ()
|
|
1096
|
+
it('should correctly validate an incorrect XRP hash', <span class="fstat-no" title="function not covered" >() =</span>> <span class="cstat-no" title="statement not covered" >validations.ripple.isTxHash('C6593DD2A32ED5120DF1FE84A9CCAF06ADDC2EF89F720CBAC3E8069C0E').should.be.false)</span>;
|
|
1343
1097
|
|
|
1344
|
-
it('should return false when passed a non-hex string', ()
|
|
1098
|
+
it('should return false when passed a non-hex string', <span class="fstat-no" title="function not covered" >() =</span>> <span class="cstat-no" title="statement not covered" >validations.ripple.isTxHash('Yet again this is not a hex string').should.be.false)</span>;
|
|
1345
1099
|
});
|
|
1346
1100
|
});
|
|
1347
1101
|
|
|
1348
1102
|
describe('ZEC', () => {
|
|
1349
1103
|
describe('isAddress', () => {
|
|
1350
|
-
it('should correctly validate valid ZEC addresses', ()
|
|
1104
|
+
it('should correctly validate valid ZEC addresses', <span class="fstat-no" title="function not covered" >() =</span>> <span class="cstat-no" title="statement not covered" >validations.zcash.isAddress('t1Jxptj7GnXQRsLNH5wWnDrGwEipEB3aZtf').should.be.true)</span>;
|
|
1351
1105
|
|
|
1352
|
-
it('should correctly validate an incorrect ZEC address', ()
|
|
1106
|
+
it('should correctly validate an incorrect ZEC address', <span class="fstat-no" title="function not covered" >() =</span>> <span class="cstat-no" title="statement not covered" >validations.zcash.isAddress('t1Jxptj7GnXQRsLNH5wWnDrGwEipEB3aZtf1').should.be.false)</span>;
|
|
1353
1107
|
});
|
|
1354
1108
|
|
|
1355
1109
|
describe('isTxHash', () => {
|
|
1356
|
-
it('should correctly validate a valid ZEC hash', ()
|
|
1110
|
+
it('should correctly validate a valid ZEC hash', <span class="fstat-no" title="function not covered" >() =</span>> <span class="cstat-no" title="statement not covered" >validations.zcash.isTxHash('715c23949b85581de432f174a9e7f4d3f9e74b008064e2c68e7a52b1ec38e961').should.be.true)</span>;
|
|
1357
1111
|
|
|
1358
|
-
it('should correctly validate an incorrect ZEC hash', ()
|
|
1112
|
+
it('should correctly validate an incorrect ZEC hash', <span class="fstat-no" title="function not covered" >() =</span>> <span class="cstat-no" title="statement not covered" >validations.zcash.isTxHash('715c23949b85581de432f174a9e7f4d3f9e74b008064e2c68e7a52b1ec38e9611').should.be.false)</span>;
|
|
1359
1113
|
|
|
1360
|
-
it('should return false when passed a non-hex string', ()
|
|
1114
|
+
it('should return false when passed a non-hex string', <span class="fstat-no" title="function not covered" >() =</span>> <span class="cstat-no" title="statement not covered" >validations.zcash.isTxHash('Yet again this is not a hex string').should.be.false)</span>;
|
|
1361
1115
|
});
|
|
1362
1116
|
});
|
|
1363
1117
|
|
|
1364
1118
|
describe('ZEN', () => {
|
|
1365
1119
|
describe('isAddress', () => {
|
|
1366
|
-
it('should correctly validate valid ZEN addresses', ()
|
|
1120
|
+
it('should correctly validate valid ZEN addresses', <span class="fstat-no" title="function not covered" >() =</span>> <span class="cstat-no" title="statement not covered" >validations.horizen.isAddress('znUovxhrE91tep6D7YtgSc3XJZoYQLVDwVn').should.be.true)</span>;
|
|
1367
1121
|
|
|
1368
|
-
it('should correctly validate an incorrect ZEN address', ()
|
|
1122
|
+
it('should correctly validate an incorrect ZEN address', <span class="fstat-no" title="function not covered" >() =</span>> <span class="cstat-no" title="statement not covered" >validations.horizen.isAddress('znUovxhrE91tep6D7YtgSc3XJZoYQLVDwVn1').should.be.false)</span>;
|
|
1369
1123
|
});
|
|
1370
1124
|
|
|
1371
1125
|
describe('isTxHash', () => {
|
|
1372
|
-
it('should correctly validate a valid ZEN hash', ()
|
|
1126
|
+
it('should correctly validate a valid ZEN hash', <span class="fstat-no" title="function not covered" >() =</span>> <span class="cstat-no" title="statement not covered" >validations.horizen.isTxHash('e5d31deb3fee023758f0b79d06489df975fce9aa53351b9b5c8491e4c33c74b7').should.be.true)</span>;
|
|
1373
1127
|
|
|
1374
|
-
it('should correctly validate an incorrect ZEN hash', ()
|
|
1128
|
+
it('should correctly validate an incorrect ZEN hash', <span class="fstat-no" title="function not covered" >() =</span>> <span class="cstat-no" title="statement not covered" >validations.horizen.isTxHash('e5d31deb3fee023758f0b79d06489df975fce9aa53351b9b5c8491e4c33c74b71').should.be.false)</span>;
|
|
1375
1129
|
|
|
1376
|
-
it('should return false when passed a non-hex string', ()
|
|
1130
|
+
it('should return false when passed a non-hex string', <span class="fstat-no" title="function not covered" >() =</span>> <span class="cstat-no" title="statement not covered" >validations.horizen.isTxHash('Yet again this is not a hex string').should.be.false)</span>;
|
|
1377
1131
|
});
|
|
1378
1132
|
});
|
|
1379
1133
|
|
|
1380
1134
|
describe('ZIL', () => {
|
|
1381
1135
|
describe('isAddress', () => {
|
|
1382
|
-
it('should correctly validate valid ZIL addresses', ()
|
|
1383
|
-
|
|
1384
|
-
it('should correctly validate an incorrect ZIL address', () => validations.zilliqa.isAddress('0x14456246cc53d31f0a2EB00FA0248F7aEbD3fa8').should.be.false);
|
|
1385
|
-
});
|
|
1386
|
-
|
|
1387
|
-
describe('isTxHash', () => {
|
|
1388
|
-
it('should correctly validate a valid ZIL hash', () => validations.zilliqa.isTxHash('0xb9a04481c546258e339f8ce4cccdee3f179cc37a8f099f0608baf39e0a819f75').should.be.true);
|
|
1389
|
-
|
|
1390
|
-
it('should correctly validate an incorrect ZIL hash', () => validations.zilliqa.isTxHash('0xb9a04481c546258e339f8ce4cccdee3f179cc37a8f099f0608baf39e0a819f7').should.be.false);
|
|
1391
|
-
|
|
1392
|
-
it('should return false when passed a non-hex string', () => validations.zilliqa.isTxHash('Yet again this is not a hex string').should.be.false);
|
|
1393
|
-
});
|
|
1394
|
-
});
|
|
1395
|
-
|
|
1396
|
-
describe('ALGO', () => {
|
|
1397
|
-
describe('isAddress', () => {
|
|
1398
|
-
it('should correctly validate valid ALGO addresses', () => validations.algorand.isAddress('GX3XLHSRMFTADVKJBBQBTZ6BKINW6ZO5JHXWGCWB4CPDNPDQ2PIYN4AVHQ').should.be.true);
|
|
1399
|
-
|
|
1400
|
-
it('should correctly validate an incorrect ALGO address', () => validations.algorand.isAddress('GX3XLHBQBTZ6BKINW6ZO5JHXWGCWB4CPDNPDQ2PIYN4AVHQ').should.be.false);
|
|
1401
|
-
});
|
|
1402
|
-
|
|
1403
|
-
describe('isTxHash', () => {
|
|
1404
|
-
it('should correctly validate a valid ALGO hash', () => validations.algorand.isTxHash('TDITWGH5FODF2EUSKBAZ4DDC323NDBCBCE6BSXVXTZBINTCVQVVQ').should.be.true);
|
|
1405
|
-
|
|
1406
|
-
it('should correctly validate an incorrect ALGO hash', () => validations.algorand.isTxHash('TDITWGH5FOBAZ4DDC323NDBCBCE6BSXVXTZBINTCVQVVQ').should.be.false);
|
|
1407
|
-
|
|
1408
|
-
it('should return false when passed a non-hex string', () => validations.algorand.isTxHash('Yet again this is not a hex string').should.be.false);
|
|
1409
|
-
});
|
|
1410
|
-
});
|
|
1411
|
-
|
|
1412
|
-
describe('DOT', () => {
|
|
1413
|
-
describe('isAddress', () => {
|
|
1414
|
-
it('should correctly validate valid DOT addresses', () => validations.polkadot.isAddress('14YJztsPZEiKuKhU3qLd6JjiY4awfdUru8Xu7BDdZAUuG8S6').should.be.true);
|
|
1415
|
-
|
|
1416
|
-
it('should correctly validate an incorrect DOT address', () => validations.polkadot.isAddress('14YJztsPZEiKuKjiY4awfdUru8Xu7BDdZAUuG8S6').should.be.false);
|
|
1417
|
-
});
|
|
1418
|
-
|
|
1419
|
-
describe('isTxHash', () => {
|
|
1420
|
-
it('should correctly validate a valid DOT hash', () => validations.polkadot.isTxHash('0x975ba4cfd83dd7f4f6e2c1932f4aeb650391f00d57c3856907d668a99fd90609').should.be.true);
|
|
1421
|
-
|
|
1422
|
-
it('should correctly validate an incorrect DOT hash', () => validations.polkadot.isTxHash('0x975ba4cfd83dd7f4f2f4aeb650391f00d57c3856907d668a99fd90609').should.be.false);
|
|
1423
|
-
|
|
1424
|
-
it('should return false when passed a non-hex string', () => validations.polkadot.isTxHash('Yet again this is not a hex string').should.be.false);
|
|
1425
|
-
});
|
|
1426
|
-
});
|
|
1427
|
-
|
|
1428
|
-
describe('ATOM', () => {
|
|
1429
|
-
describe('isAddress', () => {
|
|
1430
|
-
it('should correctly validate valid ATOM addresses', () => validations.cosmos.isAddress('cosmos153lf4zntqt33a4v0sm5cytrxyqn78q7kz8j8x5').should.be.true);
|
|
1431
|
-
|
|
1432
|
-
it('should correctly validate an incorrect ATOM address', () => validations.cosmos.isAddress('kosmos153lf4zntqt33a4v0sm5cytrxyqn78q7kz8j8x5').should.be.false);
|
|
1433
|
-
|
|
1434
|
-
it('should correctly validate an incorrect (too long) ATOM address', () => validations.cosmos.isAddress('cosmos153lf4zntqt33a4v0sm5cytrxyqn78q7kz8j8x50').should.be.false);
|
|
1435
|
-
});
|
|
1436
|
-
|
|
1437
|
-
describe('isTxHash', () => {
|
|
1438
|
-
it('should correctly validate a valid ATOM hash', () => validations.cosmos.isTxHash('BFA0252193CCAA0592AF2A27541473E7F6422A9AD85CFC9525CF67FA2AA2CD6F').should.be.true);
|
|
1439
|
-
|
|
1440
|
-
it('should correctly validate an incorrect ATOM hash', () => validations.cosmos.isTxHash('BFA0252193CCAA0592AF2A27541473E7').should.be.false);
|
|
1441
|
-
|
|
1442
|
-
it('should return false when passed a non-hex string', () => validations.cosmos.isTxHash('ZZA0252193CCAA0592AF2A27541473E7F6422A9AD85CFC9525CF67FA2AA2CD6F').should.be.false);
|
|
1443
|
-
});
|
|
1444
|
-
});
|
|
1445
|
-
|
|
1446
|
-
describe('SOL', () => {
|
|
1447
|
-
describe('isAddress', () => {
|
|
1448
|
-
it('should correctly validate valid SOL addresses', () => validations.solana.isAddress('A4JXQF7p9sHR5apRy2hVgKFAHHs7jdpQv9kFGLDit24T').should.be.true);
|
|
1449
|
-
|
|
1450
|
-
it('should correctly validate an incorrect SOL address', () => validations.solana.isAddress('L0JXQF7p9sHR5apRy2hVgKFAHHs7jdpQv9kFGLDit24T').should.be.false);
|
|
1451
|
-
|
|
1452
|
-
it('should correctly validate an incorrect (too long) SOL address', () => validations.solana.isAddress('A4JXQF7p9sHR5apRy2hVgKFAHHs7jdpQv9kFGLDit24TAAAAAAAAAAAAAAA').should.be.false);
|
|
1453
|
-
});
|
|
1454
|
-
|
|
1455
|
-
describe('isTxHash', () => {
|
|
1456
|
-
it('should correctly validate a valid SOL hash', () => validations.solana.isTxHash('2WcPszZnXBLpu9WzLbGRfwzETPHfTRi4E8fmVedFT4bPYc1BiELG3Ldway6oPTSXpVJZRM4mqEdz2Uuh5n9VQp8x').should.be.true);
|
|
1457
|
-
|
|
1458
|
-
it('should correctly validate an incorrect SOL hash', () => validations.solana.isTxHash('2WcPszZnXBLpu9WzLbGRfwzET').should.be.false);
|
|
1459
|
-
});
|
|
1460
|
-
});
|
|
1461
|
-
|
|
1462
|
-
describe('BSC', () => {
|
|
1463
|
-
describe('isAddress', () => {
|
|
1464
|
-
it('should correctly validate valid BSC addresses', () => validations.binanceSmartChain.isAddress('0x5616e2b8acff064bf902b8a93cbd5da2ca1edc7c').should.be.true);
|
|
1465
|
-
|
|
1466
|
-
it('should correctly validate an incorrect BSC address', () => validations.binanceSmartChain.isAddress('0xz616e2b8acff064bf902b8a93cbd5da2ca1edc7c').should.be.false);
|
|
1467
|
-
|
|
1468
|
-
it('should correctly validate an incorrect (too long) BSC address', () => validations.binanceSmartChain.isAddress('0x5616e2b8acff064bf902b8a93cbd5da2ca1edc7caaaaa').should.be.false);
|
|
1469
|
-
});
|
|
1470
|
-
|
|
1471
|
-
describe('isTxHash', () => {
|
|
1472
|
-
it('should correctly validate a valid BSC hash', () => validations.binanceSmartChain.isTxHash('0x1a17145af3bec32f653d8ebd4c2c1b800214b17a7f8abfdda020cb1f39abe269').should.be.true);
|
|
1473
|
-
|
|
1474
|
-
it('should correctly validate an incorrect BSC hash', () => validations.binanceSmartChain.isTxHash('0x1a17145af3bec32f653d8ebd4c2c1b800214b17').should.be.false);
|
|
1475
|
-
});
|
|
1476
|
-
});
|
|
1477
|
-
|
|
1478
|
-
describe('Polygon', () => {
|
|
1479
|
-
describe('isAddress', () => {
|
|
1480
|
-
it('should correctly validate valid Polygon addresses', () => validations.polygon.isAddress('0x286c2bd6e0585f396647cbfdbfe14b92600365bb').should.be.true);
|
|
1481
|
-
|
|
1482
|
-
it('should correctly validate an incorrect Polygon address', () => validations.polygon.isAddress('0xz286c2bd6e0585f396647cbfdbfe14b92600365bb').should.be.false);
|
|
1483
|
-
|
|
1484
|
-
it('should correctly validate an incorrect (too long) Polygon address', () => validations.polygon.isAddress('0x286c2bd6e0585f396647cbfdbfe14b92600365bba').should.be.false);
|
|
1485
|
-
});
|
|
1486
|
-
|
|
1487
|
-
describe('isTxHash', () => {
|
|
1488
|
-
it('should correctly validate a valid Polygon hash', () => validations.polygon.isTxHash('0x45a491048477568dd2047a0a9b6be9cc491382e74823ea1bd53bbc67db54a867').should.be.true);
|
|
1489
|
-
|
|
1490
|
-
it('should correctly validate an incorrect Polygon hash', () => validations.polygon.isTxHash('0x45a491048477568dd2047a0a9b6be9cc491382e74823e').should.be.false);
|
|
1491
|
-
});
|
|
1492
|
-
});
|
|
1493
|
-
|
|
1494
|
-
describe('Filecoin', () => {
|
|
1495
|
-
describe('isAddress', () => {
|
|
1496
|
-
it('should correctly validate a valid Filecoin f0 address', () => validations.filecoin.isAddress('f01825161').should.be.true);
|
|
1497
|
-
|
|
1498
|
-
it('should correctly validate a valid Filecoin f1 address', () => validations.filecoin.isAddress('f1xafi3wsh7q553efnumhgeomathrehwwd2mye7oy').should.be.true);
|
|
1499
|
-
|
|
1500
|
-
it('should correctly validate a valid Filecoin f2 address', () => validations.filecoin.isAddress('f2vrab2ft4qc22mgfxgdrphd7ovvz6zs3nq3fv4oy').should.be.true);
|
|
1501
|
-
|
|
1502
|
-
it('should correctly validate a valid Filecoin f3 address', () => validations.filecoin.isAddress('f3ug2ti4finql5bxyl5q56udn5lt462miuadjg3ur467wrj6bvbrksglxyv65zoxyz4mgte3joyce3oxkk4q7q').should.be.true);
|
|
1136
|
+
it('should correctly validate valid ZIL addresses', <span class="fstat-no" title="function not covered" >() =</span>> <span class="cstat-no" title="statement not covered" >validations.zilliqa.isAddress('zil1tw5rpejf96e76ty93l7c3dn0g79h2qhhdm28a4').should.be.true)</span>;
|
|
1503
1137
|
|
|
1504
|
-
it('should correctly validate an
|
|
1138
|
+
it('should correctly validate an incorrect ZIL address', <span class="fstat-no" title="function not covered" >() =</span>> <span class="cstat-no" title="statement not covered" >validations.zilliqa.isAddress('0x14456246cc53d31f0a2EB00FA0248F7aEbD3fa8').should.be.false)</span>;
|
|
1505
1139
|
});
|
|
1506
1140
|
|
|
1507
1141
|
describe('isTxHash', () => {
|
|
1508
|
-
it('should correctly validate a valid
|
|
1142
|
+
it('should correctly validate a valid ZIL hash', <span class="fstat-no" title="function not covered" >() =</span>> <span class="cstat-no" title="statement not covered" >validations.zilliqa.isTxHash('0xb9a04481c546258e339f8ce4cccdee3f179cc37a8f099f0608baf39e0a819f75').should.be.true)</span>;
|
|
1509
1143
|
|
|
1510
|
-
it('should correctly validate an
|
|
1144
|
+
it('should correctly validate an incorrect ZIL hash', <span class="fstat-no" title="function not covered" >() =</span>> <span class="cstat-no" title="statement not covered" >validations.zilliqa.isTxHash('0xb9a04481c546258e339f8ce4cccdee3f179cc37a8f099f0608baf39e0a819f7').should.be.false)</span>;
|
|
1511
1145
|
|
|
1512
|
-
it('should
|
|
1146
|
+
it('should return false when passed a non-hex string', <span class="fstat-no" title="function not covered" >() =</span>> <span class="cstat-no" title="statement not covered" >validations.zilliqa.isTxHash('Yet again this is not a hex string').should.be.false)</span>;
|
|
1513
1147
|
});
|
|
1514
1148
|
});
|
|
1515
1149
|
});
|
|
@@ -1519,7 +1153,7 @@ describe('Validations', () => {
|
|
|
1519
1153
|
</div><!-- /wrapper -->
|
|
1520
1154
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
1521
1155
|
Code coverage
|
|
1522
|
-
generated by <a href="https://istanbul.js.org/" target="_blank">istanbul</a> at
|
|
1156
|
+
generated by <a href="https://istanbul.js.org/" target="_blank">istanbul</a> at Wed May 05 2021 10:40:15 GMT+0100 (BST)
|
|
1523
1157
|
</div>
|
|
1524
1158
|
</div>
|
|
1525
1159
|
<script src="../prettify.js"></script>
|