Best JavaScript code snippet using wpt
expectations.ts
Source:expectations.ts
1export const Julycalendar = {2 days: [3 'vendredi', 'Samedi',4 'Dimanche', 'Lundi',5 'Mardi', 'Mercredi',6 'Jeudi'7 ],8 dates: [9 {10 date: 1,11 isPassed: true,12 isToday: false,13 day: 'vendredi',14 dateISOString: '2022-07-01T10:00:00.000Z',15 mounth: '07'16 },17 {18 date: 2,19 isPassed: true,20 isToday: false,21 day: 'Samedi',22 dateISOString: '2022-07-02T10:00:00.000Z',23 mounth: '07'24 },25 {26 date: 3,27 isPassed: true,28 isToday: false,29 day: 'Dimanche',30 dateISOString: '2022-07-03T10:00:00.000Z',31 mounth: '07'32 },33 {34 date: 4,35 isPassed: true,36 isToday: false,37 day: 'Lundi',38 dateISOString: '2022-07-04T10:00:00.000Z',39 mounth: '07'40 },41 {42 date: 5,43 isPassed: true,44 isToday: false,45 day: 'Mardi',46 dateISOString: '2022-07-05T10:00:00.000Z',47 mounth: '07'48 },49 {50 date: 6,51 isPassed: true,52 isToday: false,53 day: 'Mercredi',54 dateISOString: '2022-07-06T10:00:00.000Z',55 mounth: '07'56 },57 {58 date: 7,59 isPassed: true,60 isToday: false,61 day: 'Jeudi',62 dateISOString: '2022-07-07T10:00:00.000Z',63 mounth: '07'64 },65 {66 date: 8,67 isPassed: true,68 isToday: false,69 day: 'vendredi',70 dateISOString: '2022-07-08T10:00:00.000Z',71 mounth: '07'72 },73 {74 date: 9,75 isPassed: true,76 isToday: false,77 day: 'Samedi',78 dateISOString: '2022-07-09T10:00:00.000Z',79 mounth: '07'80 },81 {82 date: 10,83 isPassed: true,84 isToday: false,85 day: 'Dimanche',86 dateISOString: '2022-07-10T10:00:00.000Z',87 mounth: '07'88 },89 {90 date: 11,91 isPassed: true,92 isToday: false,93 day: 'Lundi',94 dateISOString: '2022-07-11T10:00:00.000Z',95 mounth: '07'96 },97 {98 date: 12,99 isPassed: true,100 isToday: false,101 day: 'Mardi',102 dateISOString: '2022-07-12T10:00:00.000Z',103 mounth: '07'104 },105 {106 date: 13,107 isPassed: true,108 isToday: false,109 day: 'Mercredi',110 dateISOString: '2022-07-13T10:00:00.000Z',111 mounth: '07'112 },113 {114 date: 14,115 isPassed: false,116 isToday: true,117 day: 'Jeudi',118 dateISOString: '2022-07-14T10:00:00.000Z',119 mounth: '07'120 },121 {122 date: 15,123 isPassed: false,124 isToday: false,125 day: 'vendredi',126 dateISOString: '2022-07-15T10:00:00.000Z',127 mounth: '07'128 },129 {130 date: 16,131 isPassed: false,132 isToday: false,133 day: 'Samedi',134 dateISOString: '2022-07-16T10:00:00.000Z',135 mounth: '07'136 },137 {138 date: 17,139 isPassed: false,140 isToday: false,141 day: 'Dimanche',142 dateISOString: '2022-07-17T10:00:00.000Z',143 mounth: '07'144 },145 {146 date: 18,147 isPassed: false,148 isToday: false,149 day: 'Lundi',150 dateISOString: '2022-07-18T10:00:00.000Z',151 mounth: '07'152 },153 {154 date: 19,155 isPassed: false,156 isToday: false,157 day: 'Mardi',158 dateISOString: '2022-07-19T10:00:00.000Z',159 mounth: '07'160 },161 {162 date: 20,163 isPassed: false,164 isToday: false,165 day: 'Mercredi',166 dateISOString: '2022-07-20T10:00:00.000Z',167 mounth: '07'168 },169 {170 date: 21,171 isPassed: false,172 isToday: false,173 day: 'Jeudi',174 dateISOString: '2022-07-21T10:00:00.000Z',175 mounth: '07'176 },177 {178 date: 22,179 isPassed: false,180 isToday: false,181 day: 'vendredi',182 dateISOString: '2022-07-22T10:00:00.000Z',183 mounth: '07'184 },185 {186 date: 23,187 isPassed: false,188 isToday: false,189 day: 'Samedi',190 dateISOString: '2022-07-23T10:00:00.000Z',191 mounth: '07'192 },193 {194 date: 24,195 isPassed: false,196 isToday: false,197 day: 'Dimanche',198 dateISOString: '2022-07-24T10:00:00.000Z',199 mounth: '07'200 },201 {202 date: 25,203 isPassed: false,204 isToday: false,205 day: 'Lundi',206 dateISOString: '2022-07-25T10:00:00.000Z',207 mounth: '07'208 },209 {210 date: 26,211 isPassed: false,212 isToday: false,213 day: 'Mardi',214 dateISOString: '2022-07-26T10:00:00.000Z',215 mounth: '07'216 },217 {218 date: 27,219 isPassed: false,220 isToday: false,221 day: 'Mercredi',222 dateISOString: '2022-07-27T10:00:00.000Z',223 mounth: '07'224 },225 {226 date: 28,227 isPassed: false,228 isToday: false,229 day: 'Jeudi',230 dateISOString: '2022-07-28T10:00:00.000Z',231 mounth: '07'232 },233 {234 date: 29,235 isPassed: false,236 isToday: false,237 day: 'vendredi',238 dateISOString: '2022-07-29T10:00:00.000Z',239 mounth: '07'240 },241 {242 date: 30,243 isPassed: false,244 isToday: false,245 day: 'Samedi',246 dateISOString: '2022-07-30T10:00:00.000Z',247 mounth: '07'248 },249 {250 date: 31,251 isPassed: false,252 isToday: false,253 day: 'Dimanche',254 dateISOString: '2022-07-31T10:00:00.000Z',255 mounth: '07'256 }257 ],258 currentmounth: {259 stringFormat: "Juillet", 260 numberFormat: 6261 },262 currentYear: 2022263}264export const septemberCalendar = {265 days: [266 'Jeudi', 'vendredi',267 'Samedi', 'Dimanche',268 'Lundi', 'Mardi',269 'Mercredi'270 ],271 dates: [272 {273 date: 1,274 isPassed: false,275 isToday: false,276 day: 'Jeudi',277 dateISOString: '2022-09-01T10:00:00.000Z',278 mounth: '09'279 },280 {281 date: 2,282 isPassed: false,283 isToday: false,284 day: 'vendredi',285 dateISOString: '2022-09-02T10:00:00.000Z',286 mounth: '09'287 },288 {289 date: 3,290 isPassed: false,291 isToday: false,292 day: 'Samedi',293 dateISOString: '2022-09-03T10:00:00.000Z',294 mounth: '09'295 },296 {297 date: 4,298 isPassed: false,299 isToday: false,300 day: 'Dimanche',301 dateISOString: '2022-09-04T10:00:00.000Z',302 mounth: '09'303 },304 {305 date: 5,306 isPassed: false,307 isToday: false,308 day: 'Lundi',309 dateISOString: '2022-09-05T10:00:00.000Z',310 mounth: '09'311 },312 {313 date: 6,314 isPassed: false,315 isToday: false,316 day: 'Mardi',317 dateISOString: '2022-09-06T10:00:00.000Z',318 mounth: '09'319 },320 {321 date: 7,322 isPassed: false,323 isToday: false,324 day: 'Mercredi',325 dateISOString: '2022-09-07T10:00:00.000Z',326 mounth: '09'327 },328 {329 date: 8,330 isPassed: false,331 isToday: false,332 day: 'Jeudi',333 dateISOString: '2022-09-08T10:00:00.000Z',334 mounth: '09'335 },336 {337 date: 9,338 isPassed: false,339 isToday: false,340 day: 'vendredi',341 dateISOString: '2022-09-09T10:00:00.000Z',342 mounth: '09'343 },344 {345 date: 10,346 isPassed: false,347 isToday: false,348 day: 'Samedi',349 dateISOString: '2022-09-10T10:00:00.000Z',350 mounth: '09'351 },352 {353 date: 11,354 isPassed: false,355 isToday: false,356 day: 'Dimanche',357 dateISOString: '2022-09-11T10:00:00.000Z',358 mounth: '09'359 },360 {361 date: 12,362 isPassed: false,363 isToday: false,364 day: 'Lundi',365 dateISOString: '2022-09-12T10:00:00.000Z',366 mounth: '09'367 },368 {369 date: 13,370 isPassed: false,371 isToday: false,372 day: 'Mardi',373 dateISOString: '2022-09-13T10:00:00.000Z',374 mounth: '09'375 },376 {377 date: 14,378 isPassed: false,379 isToday: false,380 day: 'Mercredi',381 dateISOString: '2022-09-14T10:00:00.000Z',382 mounth: '09'383 },384 {385 date: 15,386 isPassed: false,387 isToday: false,388 day: 'Jeudi',389 dateISOString: '2022-09-15T10:00:00.000Z',390 mounth: '09'391 },392 {393 date: 16,394 isPassed: false,395 isToday: false,396 day: 'vendredi',397 dateISOString: '2022-09-16T10:00:00.000Z',398 mounth: '09'399 },400 {401 date: 17,402 isPassed: false,403 isToday: false,404 day: 'Samedi',405 dateISOString: '2022-09-17T10:00:00.000Z',406 mounth: '09'407 },408 {409 date: 18,410 isPassed: false,411 isToday: false,412 day: 'Dimanche',413 dateISOString: '2022-09-18T10:00:00.000Z',414 mounth: '09'415 },416 {417 date: 19,418 isPassed: false,419 isToday: false,420 day: 'Lundi',421 dateISOString: '2022-09-19T10:00:00.000Z',422 mounth: '09'423 },424 {425 date: 20,426 isPassed: false,427 isToday: false,428 day: 'Mardi',429 dateISOString: '2022-09-20T10:00:00.000Z',430 mounth: '09'431 },432 {433 date: 21,434 isPassed: false,435 isToday: false,436 day: 'Mercredi',437 dateISOString: '2022-09-21T10:00:00.000Z',438 mounth: '09'439 },440 {441 date: 22,442 isPassed: false,443 isToday: false,444 day: 'Jeudi',445 dateISOString: '2022-09-22T10:00:00.000Z',446 mounth: '09'447 },448 {449 date: 23,450 isPassed: false,451 isToday: false,452 day: 'vendredi',453 dateISOString: '2022-09-23T10:00:00.000Z',454 mounth: '09'455 },456 {457 date: 24,458 isPassed: false,459 isToday: false,460 day: 'Samedi',461 dateISOString: '2022-09-24T10:00:00.000Z',462 mounth: '09'463 },464 {465 date: 25,466 isPassed: false,467 isToday: false,468 day: 'Dimanche',469 dateISOString: '2022-09-25T10:00:00.000Z',470 mounth: '09'471 },472 {473 date: 26,474 isPassed: false,475 isToday: false,476 day: 'Lundi',477 dateISOString: '2022-09-26T10:00:00.000Z',478 mounth: '09'479 },480 {481 date: 27,482 isPassed: false,483 isToday: false,484 day: 'Mardi',485 dateISOString: '2022-09-27T10:00:00.000Z',486 mounth: '09'487 },488 {489 date: 28,490 isPassed: false,491 isToday: false,492 day: 'Mercredi',493 dateISOString: '2022-09-28T10:00:00.000Z',494 mounth: '09'495 },496 {497 date: 29,498 isPassed: false,499 isToday: false,500 day: 'Jeudi',501 dateISOString: '2022-09-29T10:00:00.000Z',502 mounth: '09'503 },504 {505 date: 30,506 isPassed: false,507 isToday: false,508 day: 'vendredi',509 dateISOString: '2022-09-30T10:00:00.000Z',510 mounth: '09'511 }512 ],513 currentmounth: {514 stringFormat: "Septembre", 515 numberFormat: 8516 },517 currentYear: 2022518}519export const januaryNextYearCalendar = {520 days: [521 'Dimanche', 'Lundi',522 'Mardi', 'Mercredi',523 'Jeudi', 'vendredi',524 'Samedi'525 ],526 dates: [527 {528 date: 1,529 isPassed: false,530 isToday: false,531 day: 'Dimanche',532 dateISOString: '2023-01-01T11:00:00.000Z',533 mounth: '01'534 },535 {536 date: 2,537 isPassed: false,538 isToday: false,539 day: 'Lundi',540 dateISOString: '2023-01-02T11:00:00.000Z',541 mounth: '01'542 },543 {544 date: 3,545 isPassed: false,546 isToday: false,547 day: 'Mardi',548 dateISOString: '2023-01-03T11:00:00.000Z',549 mounth: '01'550 },551 {552 date: 4,553 isPassed: false,554 isToday: false,555 day: 'Mercredi',556 dateISOString: '2023-01-04T11:00:00.000Z',557 mounth: '01'558 },559 {560 date: 5,561 isPassed: false,562 isToday: false,563 day: 'Jeudi',564 dateISOString: '2023-01-05T11:00:00.000Z',565 mounth: '01'566 },567 {568 date: 6,569 isPassed: false,570 isToday: false,571 day: 'vendredi',572 dateISOString: '2023-01-06T11:00:00.000Z',573 mounth: '01'574 },575 {576 date: 7,577 isPassed: false,578 isToday: false,579 day: 'Samedi',580 dateISOString: '2023-01-07T11:00:00.000Z',581 mounth: '01'582 },583 {584 date: 8,585 isPassed: false,586 isToday: false,587 day: 'Dimanche',588 dateISOString: '2023-01-08T11:00:00.000Z',589 mounth: '01'590 },591 {592 date: 9,593 isPassed: false,594 isToday: false,595 day: 'Lundi',596 dateISOString: '2023-01-09T11:00:00.000Z',597 mounth: '01'598 },599 {600 date: 10,601 isPassed: false,602 isToday: false,603 day: 'Mardi',604 dateISOString: '2023-01-10T11:00:00.000Z',605 mounth: '01'606 },607 {608 date: 11,609 isPassed: false,610 isToday: false,611 day: 'Mercredi',612 dateISOString: '2023-01-11T11:00:00.000Z',613 mounth: '01'614 },615 {616 date: 12,617 isPassed: false,618 isToday: false,619 day: 'Jeudi',620 dateISOString: '2023-01-12T11:00:00.000Z',621 mounth: '01'622 },623 {624 date: 13,625 isPassed: false,626 isToday: false,627 day: 'vendredi',628 dateISOString: '2023-01-13T11:00:00.000Z',629 mounth: '01'630 },631 {632 date: 14,633 isPassed: false,634 isToday: false,635 day: 'Samedi',636 dateISOString: '2023-01-14T11:00:00.000Z',637 mounth: '01'638 },639 {640 date: 15,641 isPassed: false,642 isToday: false,643 day: 'Dimanche',644 dateISOString: '2023-01-15T11:00:00.000Z',645 mounth: '01'646 },647 {648 date: 16,649 isPassed: false,650 isToday: false,651 day: 'Lundi',652 dateISOString: '2023-01-16T11:00:00.000Z',653 mounth: '01'654 },655 {656 date: 17,657 isPassed: false,658 isToday: false,659 day: 'Mardi',660 dateISOString: '2023-01-17T11:00:00.000Z',661 mounth: '01'662 },663 {664 date: 18,665 isPassed: false,666 isToday: false,667 day: 'Mercredi',668 dateISOString: '2023-01-18T11:00:00.000Z',669 mounth: '01'670 },671 {672 date: 19,673 isPassed: false,674 isToday: false,675 day: 'Jeudi',676 dateISOString: '2023-01-19T11:00:00.000Z',677 mounth: '01'678 },679 {680 date: 20,681 isPassed: false,682 isToday: false,683 day: 'vendredi',684 dateISOString: '2023-01-20T11:00:00.000Z',685 mounth: '01'686 },687 {688 date: 21,689 isPassed: false,690 isToday: false,691 day: 'Samedi',692 dateISOString: '2023-01-21T11:00:00.000Z',693 mounth: '01'694 },695 {696 date: 22,697 isPassed: false,698 isToday: false,699 day: 'Dimanche',700 dateISOString: '2023-01-22T11:00:00.000Z',701 mounth: '01'702 },703 {704 date: 23,705 isPassed: false,706 isToday: false,707 day: 'Lundi',708 dateISOString: '2023-01-23T11:00:00.000Z',709 mounth: '01'710 },711 {712 date: 24,713 isPassed: false,714 isToday: false,715 day: 'Mardi',716 dateISOString: '2023-01-24T11:00:00.000Z',717 mounth: '01'718 },719 {720 date: 25,721 isPassed: false,722 isToday: false,723 day: 'Mercredi',724 dateISOString: '2023-01-25T11:00:00.000Z',725 mounth: '01'726 },727 {728 date: 26,729 isPassed: false,730 isToday: false,731 day: 'Jeudi',732 dateISOString: '2023-01-26T11:00:00.000Z',733 mounth: '01'734 },735 {736 date: 27,737 isPassed: false,738 isToday: false,739 day: 'vendredi',740 dateISOString: '2023-01-27T11:00:00.000Z',741 mounth: '01'742 },743 {744 date: 28,745 isPassed: false,746 isToday: false,747 day: 'Samedi',748 dateISOString: '2023-01-28T11:00:00.000Z',749 mounth: '01'750 },751 {752 date: 29,753 isPassed: false,754 isToday: false,755 day: 'Dimanche',756 dateISOString: '2023-01-29T11:00:00.000Z',757 mounth: '01'758 },759 {760 date: 30,761 isPassed: false,762 isToday: false,763 day: 'Lundi',764 dateISOString: '2023-01-30T11:00:00.000Z',765 mounth: '01'766 },767 {768 date: 31,769 isPassed: false,770 isToday: false,771 day: 'Mardi',772 dateISOString: '2023-01-31T11:00:00.000Z',773 mounth: '01'774 }775 ],776 currentmounth: {777 stringFormat: "Janvier", 778 numberFormat: 0779 },780 currentYear: 2023781}782export const previousjanuary = {783 days: [784 'Samedi', 'Dimanche',785 'Lundi', 'Mardi',786 'Mercredi', 'Jeudi',787 'vendredi'788 ],789 dates: [790 {791 date: 1,792 isPassed: false,793 isToday: false,794 day: 'Samedi',795 dateISOString: '2022-01-01T11:00:00.000Z',796 mounth: '01'797 },798 {799 date: 2,800 isPassed: false,801 isToday: false,802 day: 'Dimanche',803 dateISOString: '2022-01-02T11:00:00.000Z',804 mounth: '01'805 },806 {807 date: 3,808 isPassed: false,809 isToday: false,810 day: 'Lundi',811 dateISOString: '2022-01-03T11:00:00.000Z',812 mounth: '01'813 },814 {815 date: 4,816 isPassed: false,817 isToday: false,818 day: 'Mardi',819 dateISOString: '2022-01-04T11:00:00.000Z',820 mounth: '01'821 },822 {823 date: 5,824 isPassed: false,825 isToday: false,826 day: 'Mercredi',827 dateISOString: '2022-01-05T11:00:00.000Z',828 mounth: '01'829 },830 {831 date: 6,832 isPassed: false,833 isToday: false,834 day: 'Jeudi',835 dateISOString: '2022-01-06T11:00:00.000Z',836 mounth: '01'837 },838 {839 date: 7,840 isPassed: false,841 isToday: false,842 day: 'vendredi',843 dateISOString: '2022-01-07T11:00:00.000Z',844 mounth: '01'845 },846 {847 date: 8,848 isPassed: false,849 isToday: false,850 day: 'Samedi',851 dateISOString: '2022-01-08T11:00:00.000Z',852 mounth: '01'853 },854 {855 date: 9,856 isPassed: false,857 isToday: false,858 day: 'Dimanche',859 dateISOString: '2022-01-09T11:00:00.000Z',860 mounth: '01'861 },862 {863 date: 10,864 isPassed: false,865 isToday: false,866 day: 'Lundi',867 dateISOString: '2022-01-10T11:00:00.000Z',868 mounth: '01'869 },870 {871 date: 11,872 isPassed: false,873 isToday: false,874 day: 'Mardi',875 dateISOString: '2022-01-11T11:00:00.000Z',876 mounth: '01'877 },878 {879 date: 12,880 isPassed: false,881 isToday: false,882 day: 'Mercredi',883 dateISOString: '2022-01-12T11:00:00.000Z',884 mounth: '01'885 },886 {887 date: 13,888 isPassed: false,889 isToday: false,890 day: 'Jeudi',891 dateISOString: '2022-01-13T11:00:00.000Z',892 mounth: '01'893 },894 {895 date: 14,896 isPassed: false,897 isToday: false,898 day: 'vendredi',899 dateISOString: '2022-01-14T11:00:00.000Z',900 mounth: '01'901 },902 {903 date: 15,904 isPassed: false,905 isToday: false,906 day: 'Samedi',907 dateISOString: '2022-01-15T11:00:00.000Z',908 mounth: '01'909 },910 {911 date: 16,912 isPassed: false,913 isToday: false,914 day: 'Dimanche',915 dateISOString: '2022-01-16T11:00:00.000Z',916 mounth: '01'917 },918 {919 date: 17,920 isPassed: false,921 isToday: false,922 day: 'Lundi',923 dateISOString: '2022-01-17T11:00:00.000Z',924 mounth: '01'925 },926 {927 date: 18,928 isPassed: false,929 isToday: false,930 day: 'Mardi',931 dateISOString: '2022-01-18T11:00:00.000Z',932 mounth: '01'933 },934 {935 date: 19,936 isPassed: false,937 isToday: false,938 day: 'Mercredi',939 dateISOString: '2022-01-19T11:00:00.000Z',940 mounth: '01'941 },942 {943 date: 20,944 isPassed: false,945 isToday: false,946 day: 'Jeudi',947 dateISOString: '2022-01-20T11:00:00.000Z',948 mounth: '01'949 },950 {951 date: 21,952 isPassed: false,953 isToday: false,954 day: 'vendredi',955 dateISOString: '2022-01-21T11:00:00.000Z',956 mounth: '01'957 },958 {959 date: 22,960 isPassed: false,961 isToday: false,962 day: 'Samedi',963 dateISOString: '2022-01-22T11:00:00.000Z',964 mounth: '01'965 },966 {967 date: 23,968 isPassed: false,969 isToday: false,970 day: 'Dimanche',971 dateISOString: '2022-01-23T11:00:00.000Z',972 mounth: '01'973 },974 {975 date: 24,976 isPassed: false,977 isToday: false,978 day: 'Lundi',979 dateISOString: '2022-01-24T11:00:00.000Z',980 mounth: '01'981 },982 {983 date: 25,984 isPassed: false,985 isToday: false,986 day: 'Mardi',987 dateISOString: '2022-01-25T11:00:00.000Z',988 mounth: '01'989 },990 {991 date: 26,992 isPassed: false,993 isToday: false,994 day: 'Mercredi',995 dateISOString: '2022-01-26T11:00:00.000Z',996 mounth: '01'997 },998 {999 date: 27,1000 isPassed: false,1001 isToday: false,1002 day: 'Jeudi',1003 dateISOString: '2022-01-27T11:00:00.000Z',1004 mounth: '01'1005 },1006 {1007 date: 28,1008 isPassed: false,1009 isToday: false,1010 day: 'vendredi',1011 dateISOString: '2022-01-28T11:00:00.000Z',1012 mounth: '01'1013 },1014 {1015 date: 29,1016 isPassed: false,1017 isToday: false,1018 day: 'Samedi',1019 dateISOString: '2022-01-29T11:00:00.000Z',1020 mounth: '01'1021 },1022 {1023 date: 30,1024 isPassed: false,1025 isToday: false,1026 day: 'Dimanche',1027 dateISOString: '2022-01-30T11:00:00.000Z',1028 mounth: '01'1029 },1030 {1031 date: 31,1032 isPassed: false,1033 isToday: false,1034 day: 'Lundi',1035 dateISOString: '2022-01-31T11:00:00.000Z',1036 mounth: '01'1037 }1038 ],1039 currentmounth: {1040 stringFormat: "Janvier", 1041 numberFormat: 01042 },1043 currentYear: 20221044}1045export const decemberCalendar = {1046 days: [1047 'Jeudi', 'vendredi',1048 'Samedi', 'Dimanche',1049 'Lundi', 'Mardi',1050 'Mercredi'1051 ],1052 dates: [1053 {1054 date: 1,1055 isPassed: false,1056 isToday: false,1057 day: 'Jeudi',1058 dateISOString: '2022-12-01T11:00:00.000Z',1059 mounth: '11'1060 },1061 {1062 date: 2,1063 isPassed: false,1064 isToday: false,1065 day: 'vendredi',1066 dateISOString: '2022-12-02T11:00:00.000Z',1067 mounth: '11'1068 },1069 {1070 date: 3,1071 isPassed: false,1072 isToday: false,1073 day: 'Samedi',1074 dateISOString: '2022-12-03T11:00:00.000Z',1075 mounth: '11'1076 },1077 {1078 date: 4,1079 isPassed: false,1080 isToday: false,1081 day: 'Dimanche',1082 dateISOString: '2022-12-04T11:00:00.000Z',1083 mounth: '11'1084 },1085 {1086 date: 5,1087 isPassed: false,1088 isToday: false,1089 day: 'Lundi',1090 dateISOString: '2022-12-05T11:00:00.000Z',1091 mounth: '11'1092 },1093 {1094 date: 6,1095 isPassed: false,1096 isToday: false,1097 day: 'Mardi',1098 dateISOString: '2022-12-06T11:00:00.000Z',1099 mounth: '11'1100 },1101 {1102 date: 7,1103 isPassed: false,1104 isToday: false,1105 day: 'Mercredi',1106 dateISOString: '2022-12-07T11:00:00.000Z',1107 mounth: '11'1108 },1109 {1110 date: 8,1111 isPassed: false,1112 isToday: false,1113 day: 'Jeudi',1114 dateISOString: '2022-12-08T11:00:00.000Z',1115 mounth: '11'1116 },1117 {1118 date: 9,1119 isPassed: false,1120 isToday: false,1121 day: 'vendredi',1122 dateISOString: '2022-12-09T11:00:00.000Z',1123 mounth: '11'1124 },1125 {1126 date: 10,1127 isPassed: false,1128 isToday: false,1129 day: 'Samedi',1130 dateISOString: '2022-12-10T11:00:00.000Z',1131 mounth: '11'1132 },1133 {1134 date: 11,1135 isPassed: false,1136 isToday: false,1137 day: 'Dimanche',1138 dateISOString: '2022-12-11T11:00:00.000Z',1139 mounth: '11'1140 },1141 {1142 date: 12,1143 isPassed: false,1144 isToday: false,1145 day: 'Lundi',1146 dateISOString: '2022-12-12T11:00:00.000Z',1147 mounth: '11'1148 },1149 {1150 date: 13,1151 isPassed: false,1152 isToday: false,1153 day: 'Mardi',1154 dateISOString: '2022-12-13T11:00:00.000Z',1155 mounth: '11'1156 },1157 {1158 date: 14,1159 isPassed: false,1160 isToday: false,1161 day: 'Mercredi',1162 dateISOString: '2022-12-14T11:00:00.000Z',1163 mounth: '11'1164 },1165 {1166 date: 15,1167 isPassed: false,1168 isToday: false,1169 day: 'Jeudi',1170 dateISOString: '2022-12-15T11:00:00.000Z',1171 mounth: '11'1172 },1173 {1174 date: 16,1175 isPassed: false,1176 isToday: false,1177 day: 'vendredi',1178 dateISOString: '2022-12-16T11:00:00.000Z',1179 mounth: '11'1180 },1181 {1182 date: 17,1183 isPassed: false,1184 isToday: false,1185 day: 'Samedi',1186 dateISOString: '2022-12-17T11:00:00.000Z',1187 mounth: '11'1188 },1189 {1190 date: 18,1191 isPassed: false,1192 isToday: false,1193 day: 'Dimanche',1194 dateISOString: '2022-12-18T11:00:00.000Z',1195 mounth: '11'1196 },1197 {1198 date: 19,1199 isPassed: false,1200 isToday: false,1201 day: 'Lundi',1202 dateISOString: '2022-12-19T11:00:00.000Z',1203 mounth: '11'1204 },1205 {1206 date: 20,1207 isPassed: false,1208 isToday: false,1209 day: 'Mardi',1210 dateISOString: '2022-12-20T11:00:00.000Z',1211 mounth: '11'1212 },1213 {1214 date: 21,1215 isPassed: false,1216 isToday: false,1217 day: 'Mercredi',1218 dateISOString: '2022-12-21T11:00:00.000Z',1219 mounth: '11'1220 },1221 {1222 date: 22,1223 isPassed: false,1224 isToday: false,1225 day: 'Jeudi',1226 dateISOString: '2022-12-22T11:00:00.000Z',1227 mounth: '11'1228 },1229 {1230 date: 23,1231 isPassed: false,1232 isToday: false,1233 day: 'vendredi',1234 dateISOString: '2022-12-23T11:00:00.000Z',1235 mounth: '11'1236 },1237 {1238 date: 24,1239 isPassed: false,1240 isToday: false,1241 day: 'Samedi',1242 dateISOString: '2022-12-24T11:00:00.000Z',1243 mounth: '11'1244 },1245 {1246 date: 25,1247 isPassed: false,1248 isToday: false,1249 day: 'Dimanche',1250 dateISOString: '2022-12-25T11:00:00.000Z',1251 mounth: '11'1252 },1253 {1254 date: 26,1255 isPassed: false,1256 isToday: false,1257 day: 'Lundi',1258 dateISOString: '2022-12-26T11:00:00.000Z',1259 mounth: '11'1260 },1261 {1262 date: 27,1263 isPassed: false,1264 isToday: false,1265 day: 'Mardi',1266 dateISOString: '2022-12-27T11:00:00.000Z',1267 mounth: '11'1268 },1269 {1270 date: 28,1271 isPassed: false,1272 isToday: false,1273 day: 'Mercredi',1274 dateISOString: '2022-12-28T11:00:00.000Z',1275 mounth: '11'1276 },1277 {1278 date: 29,1279 isPassed: false,1280 isToday: false,1281 day: 'Jeudi',1282 dateISOString: '2022-12-29T11:00:00.000Z',1283 mounth: '11'1284 },1285 {1286 date: 30,1287 isPassed: false,1288 isToday: false,1289 day: 'vendredi',1290 dateISOString: '2022-12-30T11:00:00.000Z',1291 mounth: '11'1292 },1293 {1294 date: 31,1295 isPassed: false,1296 isToday: false,1297 day: 'Samedi',1298 dateISOString: '2022-12-31T11:00:00.000Z',1299 mounth: '11'1300 }1301 ],1302 currentmounth: { stringFormat: 'Décembre', numberFormat: 11 },1303 currentYear: 2022...
getAssertionResult.ts
Source:getAssertionResult.ts
1import EMatcher from '../enum/EMatcher';2import IAssertionResult from '../interfaces/IAssertionResult';3const getAssertionResult = <T>(4 received: Array<T>,5 expected: T | Array<T>,6 matcher: EMatcher7): IAssertionResult => {8 let isPassed: boolean = true;9 let isEvaluable: boolean = true;10 let message: string = '';11 if (Array.isArray(expected)) {12 message = `expect(${JSON.stringify(received)}).${matcher}(${JSON.stringify(13 expected14 )})`;15 switch (matcher) {16 case EMatcher.EQUAL:17 if (received.length !== expected.length) {18 isPassed = false;19 } else {20 for (let i: number = 0; i < received.length; i++) {21 if (received[i] !== expected[i]) {22 isPassed = false;23 break;24 }25 }26 }27 break;28 case EMatcher.NOT_EQUAL:29 if (received.length !== expected.length) {30 isPassed = true;31 } else {32 for (let i: number = 0; i < received.length; i++) {33 if (received[i] !== expected[i]) {34 isPassed = true;35 break;36 } else {37 isPassed = false;38 }39 }40 }41 break;42 default:43 isEvaluable = false;44 break;45 }46 } else if (typeof expected === 'number') {47 const firstNumber: number = received[0] as unknown as number;48 let min: number = firstNumber;49 let max: number = firstNumber;50 if (received.length > 1) {51 for (let i: number = 0; i < received.length; i++) {52 const n: number = received[i] as unknown as number;53 if (n < min) {54 min = n;55 } else if (n > max) {56 max = n;57 }58 }59 }60 switch (matcher) {61 case EMatcher.GREATER_THAN:62 message = `expect(${max}).${matcher}(${expected})`;63 if (max <= expected) {64 isPassed = false;65 }66 break;67 case EMatcher.GREATER_THAN_OR_EQUAL:68 message = `expect(${max}).${matcher}(${expected})`;69 if (max < expected) {70 isPassed = false;71 }72 break;73 case EMatcher.LESS_THAN:74 message = `expect(${min}).${matcher}(${expected})`;75 if (min >= expected) {76 isPassed = false;77 }78 break;79 case EMatcher.LESS_THAN_OR_EQUAL:80 message = `expect(${min}).${matcher}(${expected})`;81 if (min > expected) {82 isPassed = false;83 }84 break;85 default:86 isEvaluable = false;87 break;88 }89 } else {90 message = `expect(${JSON.stringify(received)}).${matcher}(${expected})`;91 switch (matcher) {92 case EMatcher.CONTAINS:93 if (!received.includes(expected)) {94 isPassed = false;95 }96 break;97 case EMatcher.NOT_CONTAINS:98 if (received.includes(expected)) {99 isPassed = false;100 }101 break;102 case EMatcher.STARTS_WITH:103 if (received[0] !== expected) {104 isPassed = false;105 }106 break;107 case EMatcher.NOT_STARTS_WITH:108 if (received[0] === expected) {109 isPassed = false;110 }111 break;112 case EMatcher.ENDS_WITH:113 if (received[received.length - 1] !== expected) {114 isPassed = false;115 }116 break;117 case EMatcher.NOT_ENDS_WITH:118 if (received[received.length - 1] === expected) {119 isPassed = false;120 }121 break;122 default:123 isEvaluable = false;124 break;125 }126 }127 if (!isEvaluable) {128 isPassed = false;129 message = `${JSON.stringify(expected)} and ${JSON.stringify(130 received131 )} are not comparable using the matcher "${matcher}"`;132 }133 return {134 isPassed,135 message136 };137};...
anagrams.js
Source:anagrams.js
1//input: str1, str22//output: boolean3//input have space? uppercase?4const validAnagram = (s1, s2) => {5 if (s1.length != s2.length) {6 return false;7 }8 9 const frequencyCounter = (str) => {10 const result = {}11 for (let char of str) {12 result[char] = ++result[char] || 113 }14 return result15 }16 let s1f = frequencyCounter(s1);17 let s2f = frequencyCounter(s2);18 for (const key in s1f) {19 if (s1f[key] !== s2f[key]) {20 return false21 }22 }23 return true24}25const testAnagram = (func) => {26 let isPassed = true;27 isPassed = isPassed && func('', '') === true; // true28 isPassed = isPassed && func('aaz', 'zza') === false; // false29 isPassed = isPassed && func('anagram', 'nagaram') === true; //true30 isPassed = isPassed && func('rat', 'car') === false; // false31 isPassed = isPassed && func('awesome', 'awesom') === false; // false32 isPassed = isPassed && func("qwerty", "qeywrt") === true; // true33 isPassed = isPassed && func("texttwisttime", "timetwisttext") === true // true34 isPassed = isPassed && func('hello', 'olleh') === true; // true35 return isPassed;36}37console.log(testAnagram(validAnagram));...
Using AI Code Generation
1var wpt = require('wpt');2var wptInstance = new wpt('API_KEY');3wptInstance.isPassed('TEST_ID', function(err, data) {4 if (err) {5 console.log(err);6 } else {7 console.log(data);8 }9});10var wpt = require('wpt');11var wptInstance = new wpt('API_KEY');12wptInstance.isTestFinished('TEST_ID', function(err, data) {13 if (err) {14 console.log(err);15 } else {16 console.log(data);17 }18});19var wpt = require('wpt');20var wptInstance = new wpt('API_KEY');21wptInstance.getTestResults('TEST_ID', function(err, data) {22 if (err) {23 console.log(err);24 } else {25 console.log(data);26 }27});28var wpt = require('wpt');29var wptInstance = new wpt('API_KEY');30wptInstance.getTestResults('TEST_ID', function(err, data) {31 if (err) {32 console.log(err);33 } else {34 console.log(data);35 }36});37var wpt = require('wpt');38var wptInstance = new wpt('API_KEY');39wptInstance.getTestResults('TEST_ID', function(err, data) {40 if (err) {41 console.log(err);42 } else {43 console.log(data);44 }45});46var wpt = require('wpt');47var wptInstance = new wpt('API_KEY');48wptInstance.getTestResults('TEST_ID', function(err, data) {49 if (err) {50 console.log(err);51 } else {52 console.log(data);53 }54});55var wpt = require('wpt');56var wptInstance = new wpt('API_KEY');
Using AI Code Generation
1var wpt = require('wpt');2var wpt = new wpt('API_KEY');3wpt.isPassed('testId', function(err, data){4 if(err){5 console.log(err);6 }else{7 console.log(data);8 }9});10var wpt = require('wpt');11var wpt = new wpt('API_KEY');12wpt.getLocations(function(err, data){13 if(err){14 console.log(err);15 }else{16 console.log(data);17 }18});19var wpt = require('wpt');20var wpt = new wpt('API_KEY');21wpt.getBrowsers(function(err, data){22 if(err){23 console.log(err);24 }else{25 console.log(data);26 }27});28var wpt = require('wpt');29var wpt = new wpt('API_KEY');30wpt.getTesters(function(err, data){31 if(err){32 console.log(err);33 }else{34 console.log(data);35 }36});37var wpt = require('wpt');38var wpt = new wpt('API_KEY');39wpt.getTesters(function(err, data){40 if(err){41 console.log(err);42 }else{43 console.log(data);44 }45});46var wpt = require('wpt');47var wpt = new wpt('API_KEY');48wpt.getTesters(function(err, data){49 if(err){50 console.log(err);51 }else{52 console.log(data);53 }54});55var wpt = require('wpt');56var wpt = new wpt('API_KEY');57wpt.getTesters(function(err, data){58 if(err){59 console.log(err);60 }else{61 console.log(data);62 }63});64var wpt = require('w
Using AI Code Generation
1var wpt = require('./wpt.js');2 if(err) {3 console.log(err);4 } else {5 console.log(results);6 }7});
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!