Best JavaScript code snippet using stryker-parent
data.js
Source:data.js
1module.exports = {2 unfilteredRisksWithrejectedRisks: {3 'AUTO': {4 'POWERSOFT': {5 'value': { 'unmappedRiskData': 'data' },6 'status': 'fulfilled'7 },8 'AVIVA': {9 'error': { 'unmappedRiskData': 'data' },10 'status': 'rejected'11 }12 },13 'HAB': {14 'POWERSOFT': {15 'value': { 'unmappedRiskData': 'data' },16 'status': 'fulfilled'17 },18 'AVIVA': {19 'error': { 'unmappedRiskData': 'data' },20 'status': 'rejected'21 }22 }23 },24 unfilteredRisksWithoutrejectedRisks: {25 'AUTO': {26 'POWERSOFT': {27 'value': { 'unmappedRiskData': 'data' },28 'status': 'fulfilled'29 },30 'AVIVA': {31 'value': { 'unmappedRiskData': 'data' },32 'status': 'fulfilled'33 }34 },35 'HAB': {36 'POWERSOFT': {37 'value': { 'unmappedRiskData': 'data' },38 'status': 'fulfilled'39 },40 'AVIVA': {41 'value': { 'unmappedRiskData': 'data' },42 'status': 'fulfilled'43 }44 }45 },46 unfilteredRisksWithoutResolvedRisks: {47 'AUTO': {48 'POWERSOFT': {49 'value': { 'unmappedRiskData': 'data' },50 'status': 'rejected'51 },52 'AVIVA': {53 'value': { 'unmappedRiskData': 'data' },54 'status': 'rejected'55 }56 },57 'HAB': {58 'POWERSOFT': {59 'value': { 'unmappedRiskData': 'data' },60 'status': 'rejected'61 },62 'AVIVA': {63 'value': { 'unmappedRiskData': 'data' },64 'status': 'rejected'65 }66 }67 },68 AutoMappedResponse: {69 'vehicles': {70 '1': {71 'info': 'DODGE/RAM TRUCK/VAN DAKOTA SLT V8 CLUB C 2007',72 'endorsements': {73 '20': {74 'description': 'SEF20 - Loss of Use',75 'CGU': { 'premium': 65 }76 },77 '27': {78 'description': 'SEF27 - Legal Liability for Damage to Non-Owned Automobiles',79 'CGU': { 'premium': 15 }80 },81 '35': {82 'description': 'SEF35 - Road Assist Program',83 'CGU': { 'premium': 70 }84 },85 '44': {86 'description': 'Family Protection Endorsement',87 'CGU': { 'premium': 25 },88 'PEMB': { 'premium': 32 },89 'ROY': { 'premium': 71 },90 'WU': { 'premium': 25 }91 },92 'PAK06': {93 'description': 'PAK06 - Physical Damage Extension (OPCF20, OPCF27)',94 'PEMB': { 'premium': 65 }95 },96 '13D': {97 'description': 'SEF13D - Limited Glass Endorsement',98 'PEMB': { 'premium': -72 },99 'ROY': { 'premium': -48 },100 'WU': { 'premium': -94 }101 },102 'PAK09': {103 'description': 'PAK09 - Endorsement Package (OPCF20, OPCF27, OPCF35)',104 'ROY': { 'premium': 45 },105 'WU': { 'premium': 55 }106 }107 },108 'discounts': {109 'DISCO': {110 'description': 'Conviction free discount (CVPD)',111 'CGU': { 'percenrage': '10' }112 },113 'DISMI': {114 'description': 'Age Discount',115 'PEMB': { 'percenrage': 'Multi' }116 },117 'DISNC': {118 'description': 'Violation Free Discount',119 'PEMB': { 'percenrage': '5' }120 },121 'DISDR': {122 'description': 'Experience Discount',123 'ROY': { 'percenrage': '5' }124 },125 'DISCF': {126 'description': 'Convictions Free Discount',127 'ROY': { 'percenrage': '15' }128 },129 'DISNP': {130 'description': 'New Business Discount',131 'WU': { 'percenrage': '5' }132 }133 },134 'surcharges': {},135 'occDrivers': {},136 'CGU': {137 'QTNumber': '_59D09XGWJ',138 'IDControl': '_59D09XGWK',139 'InsurerCode': 'CGU',140 'InsurerName': 'Aviva Insurance Commpany of Canada',141 'AutomobileID': 1,142 'VehStatus': 'OK',143 'Vehcode': '275502',144 'Year': 2007,145 'Make': 'DODGE/RAM TRUCK/VAN',146 'Model': 'DAKOTA SLT V8 CLUB C',147 'RateVRG1': 8,148 'RateVRG2': 26,149 'RateVRG3': 26,150 'RateVRG4': null,151 'TerritoryCode': '01B',152 'TerritoryStat': '114',153 'TerritoryDescription': 'CALGARY',154 'PODrno': 1,155 'POName': 'Ahment Kamal',156 'RateDR1': '04',157 'RateDR2': '04',158 'RateDR3': 'O',159 'RateClass': '07',160 'RatePremium': 2483,161 '_id': '5b5ef89878faee000e04d5b1',162 'SurchargeSet': { 'SurchargeItem': [] },163 'DiscountSet': {164 'DiscountItem': [165 {166 'ItemCode': 'DISCO',167 'ItemVNO': 1,168 'ItemDRNO': 1,169 'ItemDescript': 'Conviction free discount (CVPD)',170 'ItemPercentage': '10',171 '_id': '5b5ef89878faee000e04d5b2'172 }173 ]174 },175 'EndorsementSet': {176 'EndorsementItem': [177 {178 'EndCode': '44',179 'EndDescript': 'Family Protection Endorsement',180 'EndLimit': 1000000,181 'EndIncluded': 'F',182 'EndNoCharge': 'F',183 'EndPremium': 25,184 '_id': '5b5ef89878faee000e04d5b6'185 },186 {187 'EndCode': '20',188 'EndDescript': 'SEF20 - Loss of Use',189 'EndLimit': 2000,190 'EndIncluded': 'F',191 'EndNoCharge': 'F',192 'EndPremium': 65,193 '_id': '5b5ef89878faee000e04d5b5'194 },195 {196 'EndCode': '27',197 'EndDescript': 'SEF27 - Legal Liability for Damage to Non-Owned Automobiles',198 'EndLimit': 50000,199 'EndIncluded': 'F',200 'EndNoCharge': 'F',201 'EndPremium': 15,202 '_id': '5b5ef89878faee000e04d5b4'203 },204 {205 'EndCode': '35',206 'EndDescript': 'SEF35 - Road Assist Program',207 'EndLimit': null,208 'EndIncluded': 'F',209 'EndNoCharge': 'F',210 'EndPremium': 70,211 '_id': '5b5ef89878faee000e04d5b3'212 }213 ]214 },215 'OtherPremiumEstimate': {216 'TPL200K': 0,217 'TPL300K': 0,218 'TPL500K': 0,219 'TPL1M': 0,220 'TPL2M': 0,221 'TPL3M': 0,222 'TPL4M': 0,223 'TPL5M': 0,224 'DC0': 0,225 'DC300': 0,226 'AP100': 0,227 'AP250': 0,228 'AP500': 0,229 'AP1000': 0,230 'AP1500': 0,231 'AP2000': 0,232 'AP2500': 0,233 'Coll100': 0,234 'Coll250': 0,235 'Coll500': 0,236 'Coll1000': 0,237 'Coll1500': 0,238 'Coll2000': 0,239 'Coll2500': 0,240 'Comp100': 0,241 'Comp250': 0,242 'Comp500': 0,243 'Comp1000': 0,244 'Comp1500': 0,245 'SP100': 0,246 'SP250': 0,247 'SP500': 0,248 'SP1000': 0,249 'SP1500': 0,250 'BI200K': 0,251 'BI300K': 0,252 'BI500K': 0,253 'BI1M': 0,254 'BI2M': 0,255 'BI3M': 0,256 'BI4M': 0,257 'BI5M': 0,258 'PD200K': 0,259 'PD300K': 0,260 'PD500K': 0,261 'PD1M': 0,262 'PD2M': 0,263 'PD3M': 0,264 'PD4M': 0,265 'PD5M': 0266 },267 'CoverageRate': {268 'BILimit': 1000000,269 'BIPremium': 1515,270 'PDLimit': 1000000,271 'PDPremium': 0,272 'ABLimit': 0,273 'ABPremium': 77,274 'UIMPremium': 0,275 'APDeductible': 0,276 'APPremium': 0,277 'CollDeductible': 1000,278 'CollPremium': 614,279 'CompDeductible': 1000,280 'CompPremium': 384,281 'SPDeductible': 0,282 'SPPremium': 0283 },284 'OccDrivers': [],285 '$$hashKey': 'object:11956'286 },287 'PEMB': {288 'QTNumber': '_59D09XGWJ',289 'IDControl': '_59D09XGWK',290 'InsurerCode': 'PEMB',291 'InsurerName': 'Pembridge Insurance',292 'AutomobileID': 1,293 'VehStatus': 'OK',294 'Vehcode': '275502',295 'Year': 2007,296 'Make': 'DODGE/RAM TRUCK/VAN',297 'Model': 'DAKOTA SLT V8 CLUB C',298 'RateVRG1': 8,299 'RateVRG2': 26,300 'RateVRG3': 26,301 'RateVRG4': null,302 'TerritoryCode': '05',303 'TerritoryStat': '103',304 'TerritoryDescription': 'Calgary / Grand Prairie',305 'PODrno': 1,306 'POName': 'Ahment Kamal',307 'RateDR1': '06',308 'RateDR2': '',309 'RateDR3': 'O',310 'RateClass': '07',311 'RatePremium': 1936,312 '_id': '5b5ef89878faee000e04d591',313 'SurchargeSet': { 'SurchargeItem': [] },314 'DiscountSet': {315 'DiscountItem': [316 {317 'ItemCode': 'DISMI',318 'ItemVNO': 1,319 'ItemDRNO': 1,320 'ItemDescript': 'Age Discount',321 'ItemPercentage': 'Multi',322 '_id': '5b5ef89878faee000e04d593'323 },324 {325 'ItemCode': 'DISNC',326 'ItemVNO': 1,327 'ItemDRNO': 1,328 'ItemDescript': 'Violation Free Discount',329 'ItemPercentage': '5',330 '_id': '5b5ef89878faee000e04d592'331 }332 ]333 },334 'EndorsementSet': {335 'EndorsementItem': [336 {337 'EndCode': '44',338 'EndDescript': 'Family Protection Endorsement',339 'EndLimit': 1000000,340 'EndIncluded': 'F',341 'EndNoCharge': 'F',342 'EndPremium': 32,343 '_id': '5b5ef89878faee000e04d596'344 },345 {346 'EndCode': 'PAK06',347 'EndDescript': 'PAK06 - Physical Damage Extension (OPCF20, OPCF27)',348 'EndLimit': null,349 'EndIncluded': 'F',350 'EndNoCharge': 'F',351 'EndPremium': 65,352 '_id': '5b5ef89878faee000e04d595'353 },354 {355 'EndCode': '13D',356 'EndDescript': 'SEF13D - Limited Glass Endorsement',357 'EndLimit': null,358 'EndIncluded': 'F',359 'EndNoCharge': 'F',360 'EndPremium': -72,361 '_id': '5b5ef89878faee000e04d594'362 }363 ]364 },365 'OtherPremiumEstimate': {366 'TPL200K': 0,367 'TPL300K': 0,368 'TPL500K': 0,369 'TPL1M': 0,370 'TPL2M': 0,371 'TPL3M': 0,372 'TPL4M': 0,373 'TPL5M': 0,374 'DC0': 0,375 'DC300': 0,376 'AP100': 0,377 'AP250': 0,378 'AP500': 0,379 'AP1000': 0,380 'AP1500': 0,381 'AP2000': 0,382 'AP2500': 0,383 'Coll100': 0,384 'Coll250': 0,385 'Coll500': 0,386 'Coll1000': 0,387 'Coll1500': 0,388 'Coll2000': 0,389 'Coll2500': 0,390 'Comp100': 0,391 'Comp250': 0,392 'Comp500': 0,393 'Comp1000': 0,394 'Comp1500': 0,395 'SP100': 0,396 'SP250': 0,397 'SP500': 0,398 'SP1000': 0,399 'SP1500': 0,400 'BI200K': 0,401 'BI300K': 0,402 'BI500K': 0,403 'BI1M': 0,404 'BI2M': 0,405 'BI3M': 0,406 'BI4M': 0,407 'BI5M': 0,408 'PD200K': 0,409 'PD300K': 0,410 'PD500K': 0,411 'PD1M': 0,412 'PD2M': 0,413 'PD3M': 0,414 'PD4M': 0,415 'PD5M': 0416 },417 'CoverageRate': {418 'BILimit': 1000000,419 'BIPremium': 1412,420 'PDLimit': 1000000,421 'PDPremium': 0,422 'ABLimit': 0,423 'ABPremium': 89,424 'UIMPremium': 0,425 'APDeductible': 0,426 'APPremium': 0,427 'CollDeductible': 1000,428 'CollPremium': 338,429 'CompDeductible': 1000,430 'CompPremium': 263,431 'SPDeductible': 0,432 'SPPremium': 0433 },434 'OccDrivers': [],435 '$$hashKey': 'object:11948'436 },437 'ROY': {438 'QTNumber': '_59D09XGWJ',439 'IDControl': '_59D09XGWK',440 'InsurerCode': 'ROY',441 'InsurerName': 'Royal and Sun Alliance Canada',442 'AutomobileID': 1,443 'VehStatus': 'OK',444 'Vehcode': '275502',445 'Year': 2007,446 'Make': 'DODGE/RAM TRUCK/VAN',447 'Model': 'DAKOTA SLT V8 CLUB C',448 'RateVRG1': 7,449 'RateVRG2': 27,450 'RateVRG3': 22,451 'RateVRG4': null,452 'TerritoryCode': '27',453 'TerritoryStat': '112',454 'TerritoryDescription': 'Calgary',455 'PODrno': 1,456 'POName': 'Ahment Kamal',457 'RateDR1': '04',458 'RateDR2': '',459 'RateDR3': 'O',460 'RateClass': '07',461 'RatePremium': 2428,462 '_id': '5b5ef89878faee000e04d57b',463 'SurchargeSet': { 'SurchargeItem': [] },464 'DiscountSet': {465 'DiscountItem': [466 {467 'ItemCode': 'DISDR',468 'ItemVNO': 1,469 'ItemDRNO': 1,470 'ItemDescript': 'Experience Discount',471 'ItemPercentage': '5',472 '_id': '5b5ef89878faee000e04d57d'473 },474 {475 'ItemCode': 'DISCF',476 'ItemVNO': 1,477 'ItemDRNO': 1,478 'ItemDescript': 'Convictions Free Discount',479 'ItemPercentage': '15',480 '_id': '5b5ef89878faee000e04d57c'481 }482 ]483 },484 'EndorsementSet': {485 'EndorsementItem': [486 {487 'EndCode': '44',488 'EndDescript': 'Family Protection Endorsement',489 'EndLimit': 1000000,490 'EndIncluded': 'F',491 'EndNoCharge': 'F',492 'EndPremium': 71,493 '_id': '5b5ef89878faee000e04d580'494 },495 {496 'EndCode': 'PAK09',497 'EndDescript': 'PAK09 - Endorsement Package (OPCF20, OPCF27, OPCF35)',498 'EndLimit': null,499 'EndIncluded': 'F',500 'EndNoCharge': 'F',501 'EndPremium': 45,502 '_id': '5b5ef89878faee000e04d57f'503 },504 {505 'EndCode': '13D',506 'EndDescript': 'SEF13D - Limited Glass Endorsement',507 'EndLimit': null,508 'EndIncluded': 'F',509 'EndNoCharge': 'F',510 'EndPremium': -48,511 '_id': '5b5ef89878faee000e04d57e'512 }513 ]514 },515 'OtherPremiumEstimate': {516 'TPL200K': 0,517 'TPL300K': 0,518 'TPL500K': 0,519 'TPL1M': 0,520 'TPL2M': 0,521 'TPL3M': 0,522 'TPL4M': 0,523 'TPL5M': 0,524 'DC0': 0,525 'DC300': 0,526 'AP100': 0,527 'AP250': 0,528 'AP500': 0,529 'AP1000': 0,530 'AP1500': 0,531 'AP2000': 0,532 'AP2500': 0,533 'Coll100': 0,534 'Coll250': 0,535 'Coll500': 0,536 'Coll1000': 0,537 'Coll1500': 0,538 'Coll2000': 0,539 'Coll2500': 0,540 'Comp100': 0,541 'Comp250': 0,542 'Comp500': 0,543 'Comp1000': 0,544 'Comp1500': 0,545 'SP100': 0,546 'SP250': 0,547 'SP500': 0,548 'SP1000': 0,549 'SP1500': 0,550 'BI200K': 0,551 'BI300K': 0,552 'BI500K': 0,553 'BI1M': 0,554 'BI2M': 0,555 'BI3M': 0,556 'BI4M': 0,557 'BI5M': 0,558 'PD200K': 0,559 'PD300K': 0,560 'PD500K': 0,561 'PD1M': 0,562 'PD2M': 0,563 'PD3M': 0,564 'PD4M': 0,565 'PD5M': 0566 },567 'CoverageRate': {568 'BILimit': 1000000,569 'BIPremium': 1654,570 'PDLimit': 1000000,571 'PDPremium': 0,572 'ABLimit': 0,573 'ABPremium': 82,574 'UIMPremium': 0,575 'APDeductible': 0,576 'APPremium': 0,577 'CollDeductible': 1000,578 'CollPremium': 730,579 'CompDeductible': 1000,580 'CompPremium': 320,581 'SPDeductible': 0,582 'SPPremium': 0583 },584 'OccDrivers': [],585 '$$hashKey': 'object:11952'586 },587 'WU': {588 'QTNumber': '_59D09XGWJ',589 'IDControl': '_59D09XGWK',590 'InsurerCode': 'WU',591 'InsurerName': 'INTACT Insurance',592 'AutomobileID': 1,593 'VehStatus': 'OK',594 'Vehcode': '275502',595 'Year': 2007,596 'Make': 'DODGE/RAM TRUCK/VAN',597 'Model': 'DAKOTA SLT V8 CLUB C',598 'RateVRG1': 6,599 'RateVRG2': 24,600 'RateVRG3': 20,601 'RateVRG4': null,602 'TerritoryCode': '01',603 'TerritoryStat': '101',604 'TerritoryDescription': 'Calgary',605 'PODrno': 1,606 'POName': 'Ahment Kamal',607 'RateDR1': '00',608 'RateDR2': '',609 'RateDR3': 'O',610 'RateClass': '07',611 'RatePremium': 2513,612 '_id': '5b5ef89878faee000e04d565',613 'SurchargeSet': { 'SurchargeItem': [] },614 'DiscountSet': {615 'DiscountItem': [616 {617 'ItemCode': 'DISNP',618 'ItemVNO': 1,619 'ItemDRNO': 1,620 'ItemDescript': 'New Business Discount',621 'ItemPercentage': '5',622 '_id': '5b5ef89878faee000e04d566'623 }624 ]625 },626 'EndorsementSet': {627 'EndorsementItem': [628 {629 'EndCode': '44',630 'EndDescript': 'Family Protection Endorsement',631 'EndLimit': 1000000,632 'EndIncluded': 'F',633 'EndNoCharge': 'F',634 'EndPremium': 25,635 '_id': '5b5ef89878faee000e04d569'636 },637 {638 'EndCode': 'PAK09',639 'EndDescript': 'Plus Pac - Option B',640 'EndLimit': 2500,641 'EndIncluded': 'F',642 'EndNoCharge': 'F',643 'EndPremium': 55,644 '_id': '5b5ef89878faee000e04d568'645 },646 {647 'EndCode': '13D',648 'EndDescript': 'SEF13D - Limited Glass Endorsement',649 'EndLimit': null,650 'EndIncluded': 'F',651 'EndNoCharge': 'F',652 'EndPremium': -94,653 '_id': '5b5ef89878faee000e04d567'654 }655 ]656 },657 'OtherPremiumEstimate': {658 'TPL200K': 0,659 'TPL300K': 0,660 'TPL500K': 0,661 'TPL1M': 0,662 'TPL2M': 0,663 'TPL3M': 0,664 'TPL4M': 0,665 'TPL5M': 0,666 'DC0': 0,667 'DC300': 0,668 'AP100': 0,669 'AP250': 0,670 'AP500': 0,671 'AP1000': 0,672 'AP1500': 0,673 'AP2000': 0,674 'AP2500': 0,675 'Coll100': 0,676 'Coll250': 0,677 'Coll500': 0,678 'Coll1000': 0,679 'Coll1500': 0,680 'Coll2000': 0,681 'Coll2500': 0,682 'Comp100': 0,683 'Comp250': 0,684 'Comp500': 0,685 'Comp1000': 0,686 'Comp1500': 0,687 'SP100': 0,688 'SP250': 0,689 'SP500': 0,690 'SP1000': 0,691 'SP1500': 0,692 'BI200K': 0,693 'BI300K': 0,694 'BI500K': 0,695 'BI1M': 0,696 'BI2M': 0,697 'BI3M': 0,698 'BI4M': 0,699 'BI5M': 0,700 'PD200K': 0,701 'PD300K': 0,702 'PD500K': 0,703 'PD1M': 0,704 'PD2M': 0,705 'PD3M': 0,706 'PD4M': 0,707 'PD5M': 0708 },709 'CoverageRate': {710 'BILimit': 1000000,711 'BIPremium': 3089,712 'PDLimit': 1000000,713 'PDPremium': 0,714 'ABLimit': 0,715 'ABPremium': 41,716 'UIMPremium': 0,717 'APDeductible': 0,718 'APPremium': 0,719 'CollDeductible': 1000,720 'CollPremium': 842,721 'CompDeductible': 1000,722 'CompPremium': 375,723 'SPDeductible': 0,724 'SPPremium': 0725 },726 'OccDrivers': [],727 '$$hashKey': 'object:11960'728 }729 }730 },731 'billingPlans': {732 'CGU': {733 'PlanType': 'PAC - Monthly',734 'PlanTerm': '12 Months',735 'PlanPremium': 2483,736 'PlanTax': 0,737 'PlanServiceChargeAmount': 74.49,738 'PlanServiceChargePercentage': 3,739 'PlanTotal': 2557.49,740 'PlanDownPayment': 0,741 'PlanInstallment': 213.12,742 'Installments': 12,743 '_id': '5b5ef89878faee000e04d59f',744 'PlanSchedule': {745 'InstallmentAmount': [746 213.12,747 213.12,748 213.12,749 213.12,750 213.12,751 213.12,752 213.12,753 213.12,754 213.12,755 213.12,756 213.12,757 213.17758 ],759 'InstallmentDate': [760 '2018-05-14T00:00:00.000Z',761 '2018-06-14T00:00:00.000Z',762 '2018-07-14T00:00:00.000Z',763 '2018-08-14T00:00:00.000Z',764 '2018-09-14T00:00:00.000Z',765 '2018-10-14T00:00:00.000Z',766 '2018-11-14T00:00:00.000Z',767 '2018-12-14T00:00:00.000Z',768 '2019-01-14T00:00:00.000Z',769 '2019-02-14T00:00:00.000Z',770 '2019-03-14T00:00:00.000Z',771 '2019-04-14T00:00:00.000Z'772 ]773 }774 },775 'PEMB': {776 'PlanType': 'PAC - Monthly',777 'PlanTerm': '12 Months',778 'PlanPremium': 1936,779 'PlanTax': 0,780 'PlanServiceChargeAmount': 58.08,781 'PlanServiceChargePercentage': 3,782 'PlanTotal': 1994.08,783 'PlanDownPayment': 332.35,784 'PlanInstallment': 166.17,785 'Installments': 11,786 '_id': '5b5ef89878faee000e04d582',787 'PlanSchedule': {788 'InstallmentAmount': [789 332.35,790 166.17,791 166.17,792 166.17,793 166.17,794 166.17,795 166.17,796 166.17,797 166.17,798 166.17,799 166.2800 ],801 'InstallmentDate': [802 '2018-05-14T00:00:00.000Z',803 '2018-06-14T00:00:00.000Z',804 '2018-07-14T00:00:00.000Z',805 '2018-08-14T00:00:00.000Z',806 '2018-09-14T00:00:00.000Z',807 '2018-10-14T00:00:00.000Z',808 '2018-11-14T00:00:00.000Z',809 '2018-12-14T00:00:00.000Z',810 '2019-01-14T00:00:00.000Z',811 '2019-02-14T00:00:00.000Z',812 '2019-03-14T00:00:00.000Z'813 ]814 }815 },816 'ROY': {817 'PlanType': 'Econopay - Monthly',818 'PlanTerm': '12 Months',819 'PlanPremium': 2428,820 'PlanTax': 0,821 'PlanServiceChargeAmount': 60.7,822 'PlanServiceChargePercentage': 2.5,823 'PlanTotal': 2488.7,824 'PlanDownPayment': 404.67,825 'PlanInstallment': 208.4,826 'Installments': 11,827 '_id': '5b5ef89878faee000e04d56b',828 'PlanSchedule': {829 'InstallmentAmount': [830 404.67,831 208.4,832 208.4,833 208.4,834 208.4,835 208.4,836 208.4,837 208.4,838 208.4,839 208.4,840 208.43841 ],842 'InstallmentDate': [843 '2018-05-14T00:00:00.000Z',844 '2018-06-14T00:00:00.000Z',845 '2018-07-14T00:00:00.000Z',846 '2018-08-14T00:00:00.000Z',847 '2018-09-14T00:00:00.000Z',848 '2018-10-14T00:00:00.000Z',849 '2018-11-14T00:00:00.000Z',850 '2018-12-14T00:00:00.000Z',851 '2019-01-14T00:00:00.000Z',852 '2019-02-14T00:00:00.000Z',853 '2019-03-14T00:00:00.000Z'854 ]855 }856 },857 'WU': {858 'PlanType': 'Monthly Pay Option',859 'PlanTerm': '12 Months',860 'PlanPremium': 2513,861 'PlanTax': 0,862 'PlanServiceChargeAmount': 100.52,863 'PlanServiceChargePercentage': 4,864 'PlanTotal': 2613.52,865 'PlanDownPayment': 0,866 'PlanInstallment': 217.79,867 'Installments': 12,868 '_id': '5b5ef89878faee000e04d554',869 'PlanSchedule': {870 'InstallmentAmount': [871 217.79,872 217.79,873 217.79,874 217.79,875 217.79,876 217.79,877 217.79,878 217.79,879 217.79,880 217.79,881 217.79,882 217.83883 ],884 'InstallmentDate': [885 '2018-05-14T00:00:00.000Z',886 '2018-06-14T00:00:00.000Z',887 '2018-07-14T00:00:00.000Z',888 '2018-08-14T00:00:00.000Z',889 '2018-09-14T00:00:00.000Z',890 '2018-10-14T00:00:00.000Z',891 '2018-11-14T00:00:00.000Z',892 '2018-12-14T00:00:00.000Z',893 '2019-01-14T00:00:00.000Z',894 '2019-02-14T00:00:00.000Z',895 '2019-03-14T00:00:00.000Z',896 '2019-04-14T00:00:00.000Z'897 ]898 }899 }900 }901 },902 RateObject: {903 provider: [904 {905 'name': 'POWERSOFT',906 'risk': [907 {908 'type': 'AUTO',909 'ref': '123456789963'910 }, {911 'type': 'HAB',912 'ref': '963987654321'913 }914 ],915 'selected': ['INT', 'WAN']916 }, {917 'name': 'AVIVA',918 'risk': [919 {920 'type': 'AUTO',921 'ref': '188856789963'922 }923 ],924 'selected': ['AV']925 }926 ]927 },928 ProviderControllers: {929 'AUTO': {930 'POWERSOFT': {931 'getAutoById': 'Function Reference',932 'getHabById': 'Function Reference',933 'OtherControl': 'Function Reference'934 },935 'AVIVA': {936 'getAutoById': 'Function Reference',937 'getHabById': 'Function Reference',938 'OtherControl': 'Function Reference'939 }940 },941 'HAB': {942 'POWERSOFT': {943 'getAutoById': 'Function Reference',944 'getHabById': 'Function Reference',945 'OtherControl': 'Function Reference'946 },947 'AVIVA': {948 'getAutoById': 'Function Reference',949 'getHabById': 'Function Reference',950 'OtherControl': 'Function Reference'951 }952 }953 },954 resolvedRisks: { 'HAB': { 'POWERSOFT': { 'key1': 'value1' } } }...
syntax-helpers.ts
Source:syntax-helpers.ts
1import { INSTRUMENTER_CONSTANTS as ID } from '@stryker-mutator/api/core';2import { types, NodePath } from '@babel/core';3import traverse from '@babel/traverse';4import { parse } from '@babel/parser';5import { deepFreeze } from '@stryker-mutator/util';6import { Mutant } from '../mutant';7export { ID };8const STRYKER_NAMESPACE_HELPER = 'stryNS_9fa48';9const COVER_MUTANT_HELPER = 'stryCov_9fa48';10const IS_MUTANT_ACTIVE_HELPER = 'stryMutAct_9fa48';11/**12 * Returns syntax for the header if JS/TS files13 */14export const instrumentationBabelHeader = deepFreeze(15 parse(`function ${STRYKER_NAMESPACE_HELPER}(){16 var g = new Function("return this")();17 var ns = g.${ID.NAMESPACE} || (g.${ID.NAMESPACE} = {});18 if (ns.${ID.ACTIVE_MUTANT} === undefined && g.process && g.process.env && g.process.env.${ID.ACTIVE_MUTANT_ENV_VARIABLE}) {19 ns.${ID.ACTIVE_MUTANT} = g.process.env.${ID.ACTIVE_MUTANT_ENV_VARIABLE};20 }21 function retrieveNS(){22 return ns;23 }24 ${STRYKER_NAMESPACE_HELPER} = retrieveNS;25 return retrieveNS();26}27${STRYKER_NAMESPACE_HELPER}();28function ${COVER_MUTANT_HELPER}() {29 var ns = ${STRYKER_NAMESPACE_HELPER}();30 var cov = ns.${ID.MUTATION_COVERAGE_OBJECT} || (ns.${ID.MUTATION_COVERAGE_OBJECT} = { static: {}, perTest: {} });31 function cover() {32 var c = cov.static;33 if (ns.${ID.CURRENT_TEST_ID}) {34 c = cov.perTest[ns.${ID.CURRENT_TEST_ID}] = cov.perTest[ns.${ID.CURRENT_TEST_ID}] || {};35 }36 var a = arguments;37 for(var i=0; i < a.length; i++){38 c[a[i]] = (c[a[i]] || 0) + 1;39 }40 }41 ${COVER_MUTANT_HELPER} = cover;42 cover.apply(null, arguments);43}44function ${IS_MUTANT_ACTIVE_HELPER}(id) {45 var ns = ${STRYKER_NAMESPACE_HELPER}();46 function isActive(id) {47 if (ns.${ID.ACTIVE_MUTANT} === id) {48 if (ns.${ID.HIT_COUNT} !== void 0 && ++ns.${ID.HIT_COUNT} > ns.${ID.HIT_LIMIT}) {49 throw new Error('Stryker: Hit count limit reached (' + ns.${ID.HIT_COUNT} + ')');50 }51 return true;52 }53 return false;54 }55 ${IS_MUTANT_ACTIVE_HELPER} = isActive;56 return isActive(id);57}`).program.body58) as readonly types.Statement[]; // cast here, otherwise the thing gets unwieldy to handle59/**60 * returns syntax for `global.activeMutant === $mutantId`61 * @param mutantId The id of the mutant to switch62 */63export function mutantTestExpression(mutantId: string): types.CallExpression {64 return types.callExpression(types.identifier(IS_MUTANT_ACTIVE_HELPER), [types.stringLiteral(mutantId)]);65}66interface Position {67 line: number;68 column: number;69}70function eqLocation(a: types.SourceLocation, b: types.SourceLocation): boolean {71 function eqPosition(start: Position, end: Position): boolean {72 return start.column === end.column && start.line === end.line;73 }74 return eqPosition(a.start, b.start) && eqPosition(a.end, b.end);75}76export function eqNode<T extends types.Node>(a: T, b: types.Node): b is T {77 return a.type === b.type && !!a.loc && !!b.loc && eqLocation(a.loc, b.loc);78}79export function offsetLocations(file: types.File, { position, line, column }: { position: number; line: number; column: number }): void {80 const offsetNode = (node: types.Node): void => {81 node.start! += position;82 node.end! += position;83 // we need to subtract 1, as lines always start at 184 node.loc!.start.line += line - 1;85 node.loc!.end.line += line - 1;86 if (node.loc!.start.line === line) {87 node.loc!.start.column += column;88 }89 if (node.loc!.end.line === line) {90 node.loc!.end.column += column;91 }92 };93 traverse(file, {94 enter(path) {95 offsetNode(path.node);96 },97 });98 // Don't forget the file itself!99 file.start! += position;100 file.end! += position;101}102/**103 * Returns a sequence of mutation coverage counters with an optional last expression.104 *105 * @example (global.__coverMutant__(0, 1), 40 + 2)106 * @param mutants The mutants for which covering syntax needs to be generated107 * @param targetExpression The original expression108 */109export function mutationCoverageSequenceExpression(mutants: Iterable<Mutant>, targetExpression?: types.Expression): types.Expression {110 const mutantIds = [...mutants].map((mutant) => types.stringLiteral(mutant.id));111 const sequence: types.Expression[] = [types.callExpression(types.identifier(COVER_MUTANT_HELPER), mutantIds)];112 if (targetExpression) {113 sequence.push(targetExpression);114 }115 return types.sequenceExpression(sequence);116}117export function isTypeNode(path: NodePath): boolean {118 return (119 path.isTypeAnnotation() ||120 flowTypeAnnotationNodeTypes.includes(path.node.type) ||121 tsTypeAnnotationNodeTypes.includes(path.node.type) ||122 isDeclareVariableStatement(path)123 );124}125/**126 * Determines whether or not it is a declare variable statement node.127 * @example128 * declare const foo: 'foo';129 */130function isDeclareVariableStatement(path: NodePath): boolean {131 return path.isVariableDeclaration() && path.node.declare === true;132}133const tsTypeAnnotationNodeTypes: ReadonlyArray<types.Node['type']> = Object.freeze([134 'TSAsExpression',135 'TSInterfaceDeclaration',136 'TSTypeAnnotation',137 'TSTypeAliasDeclaration',138 'TSModuleDeclaration',139 'TSEnumDeclaration',140 'TSDeclareFunction',141 'TSTypeParameterInstantiation',142]);143const flowTypeAnnotationNodeTypes: ReadonlyArray<types.Node['type']> = Object.freeze([144 'DeclareClass',145 'DeclareFunction',146 'DeclareInterface',147 'DeclareModule',148 'DeclareModuleExports',149 'DeclareTypeAlias',150 'DeclareOpaqueType',151 'DeclareVariable',152 'DeclareExportDeclaration',153 'DeclareExportAllDeclaration',154 'InterfaceDeclaration',155 'OpaqueType',156 'TypeAlias',157 'InterfaceDeclaration',158]);159export function isImportDeclaration(path: NodePath): boolean {160 return types.isTSImportEqualsDeclaration(path.node) || path.isImportDeclaration();161}162/**163 * Determines if a location (needle) is included in an other location (haystack)164 * @param haystack The range to look in165 * @param needle the range to search for166 */167export function locationIncluded(haystack: types.SourceLocation, needle: types.SourceLocation): boolean {168 const startIncluded =169 haystack.start.line < needle.start.line || (haystack.start.line === needle.start.line && haystack.start.column <= needle.start.column);170 const endIncluded = haystack.end.line > needle.end.line || (haystack.end.line === needle.end.line && haystack.end.column >= needle.end.column);171 return startIncluded && endIncluded;172}173/**174 * Determines if two locations overlap with each other175 */176export function locationOverlaps(a: types.SourceLocation, b: types.SourceLocation): boolean {177 const startIncluded = a.start.line < b.end.line || (a.start.line === b.end.line && a.start.column <= b.end.column);178 const endIncluded = a.end.line > b.start.line || (a.end.line === b.start.line && a.end.column >= b.start.column);179 return startIncluded && endIncluded;180}181/**182 * Helper for `types.cloneNode(node, deep: true, withoutLocations: false);`183 */184export function deepCloneNode<TNode extends types.Node>(node: TNode): TNode {185 return types.cloneNode(node, /* deep */ true, /* withoutLocations */ false);...
Using AI Code Generation
1var strykerParent = require('stryker-parent');2strykerParent.endIncluded();3var strykerParent = require('stryker-parent');4strykerParent.endIncluded();5var strykerParent = require('stryker-parent');6strykerParent.endIncluded();7var strykerParent = require('stryker-parent');8strykerParent.endIncluded();9var strykerParent = require('stryker-parent');10strykerParent.endIncluded();11var strykerParent = require('stryker-parent');12strykerParent.endIncluded();13var strykerParent = require('stryker-parent');14strykerParent.endIncluded();15var strykerParent = require('stryker-parent');16strykerParent.endIncluded();17var strykerParent = require('stryker-parent');18strykerParent.endIncluded();19var strykerParent = require('stryker-parent');20strykerParent.endIncluded();21var strykerParent = require('stryker-parent');22strykerParent.endIncluded();23var strykerParent = require('stryker-parent');24strykerParent.endIncluded();25var strykerParent = require('stryker-parent');26strykerParent.endIncluded();27var strykerParent = require('stryker-parent');28strykerParent.endIncluded();
Using AI Code Generation
1const strykerParent = require('stryker-parent');2strykerParent.endIncluded();3import strykerParent from 'stryker-parent';4strykerParent.endIncluded();5import * as strykerParent from 'stryker-parent';6strykerParent.endIncluded();7import strykerParent = require('stryker-parent');8strykerParent.endIncluded();9import { endIncluded } from 'stryker-parent';10endIncluded();11import { endIncluded } from 'stryker-parent';12strykerParent.endIncluded();13import strykerParent = require('stryker-parent');14strykerParent.endIncluded();15import * as strykerParent from 'stryker-parent';16strykerParent.endIncluded();17import strykerParent from 'stryker-parent';18strykerParent.endIncluded();19import { endIncluded } from 'stryker-parent';20endIncluded();21import { endIncluded } from 'stryker-parent';22strykerParent.endIncluded();23import strykerParent = require('stryker-parent');24strykerParent.endIncluded();25import * as strykerParent from 'stryker-parent';26strykerParent.endIncluded();27import strykerParent from 'stryker-parent';28strykerParent.endIncluded();
Using AI Code Generation
1endIncluded();2endIncluded();3endIncluded();4endIncluded();5endIncluded();6endIncluded();7endIncluded();8endIncluded();9endIncluded();10endIncluded();11endIncluded();12endIncluded();13endIncluded();14endIncluded();15endIncluded();16endIncluded();17endIncluded();18endIncluded();19endIncluded();20endIncluded();21endIncluded();22endIncluded();23endIncluded();24endIncluded();25endIncluded();26endIncluded();27endIncluded();28endIncluded();29endIncluded();30endIncluded();31endIncluded();32endIncluded();
Using AI Code Generation
1var strykerParent = require('stryker-parent');2var stryker = new strykerParent();3stryker.endIncluded();4var strykerParent = require('stryker-parent');5var stryker = new strykerParent();6stryker.endIncluded();7var strykerParent = require('stryker-parent');8var stryker = new strykerParent();9stryker.endIncluded();10var strykerParent = require('stryker-parent');11var stryker = new strykerParent();12stryker.endIncluded();13var strykerParent = require('stryker-parent');14var stryker = new strykerParent();15stryker.endIncluded();16var strykerParent = require('stryker-parent');17var stryker = new strykerParent();18stryker.endIncluded();19var strykerParent = require('stryker-parent');20var stryker = new strykerParent();21stryker.endIncluded();22var strykerParent = require('stryker-parent');23var stryker = new strykerParent();24stryker.endIncluded();25var strykerParent = require('stryker-parent');26var stryker = new strykerParent();27stryker.endIncluded();28var strykerParent = require('stryker-parent');29var stryker = new strykerParent();30stryker.endIncluded();31var strykerParent = require('stryker-parent');32var stryker = new strykerParent();33stryker.endIncluded();
Using AI Code Generation
1var strykerParent = require('stryker-parent');2var stryker = strykerParent.create('test');3stryker.endIncluded();4module.exports = function(config) {5 config.set({6 });7};
Using AI Code Generation
1var parent = require('stryker-parent');2var stryker = parent.endIncluded('stryker');3var strykerApi = parent.endIncluded('stryker-api');4var strykerDashboardReporter = parent.endIncluded('stryker-dashboard-reporter');5var strykerHtmlReporter = parent.endIncluded('stryker-html-reporter');6var strykerJasmine = parent.endIncluded('stryker-jasmine');7var strykerJasmineRunner = parent.endIncluded('stryker-jasmine-runner');8var strykerJasmine2Runner = parent.endIncluded('stryker-jasmine2-runner');9var strykerJasmine2 = parent.endIncluded('stryker-jasmine2');10var strykerJest = parent.endIncluded('stryker-jest');11var strykerJestRunner = parent.endIncluded('stryker-jest-runner');12var strykerJest2Runner = parent.endIncluded('stryker-jest2-runner');13var strykerKarma = parent.endIncluded('stryker-karma');14var strykerKarmaRunner = parent.endIncluded('stryker-karma-runner');15var strykerMocha = parent.endIncluded('stryker-mocha');16var strykerMochaRunner = parent.endIncluded('stryker-mocha-runner');17var strykerMochaFramework = parent.endIncluded('stryker-mocha-framework');18var strykerMochaTestRunner = parent.endIncluded('stryker-mocha-test-runner');19var strykerMochaTestRunner2 = parent.endIncluded('stryker-mocha-test-runner2');20var strykerMochaTestRunner3 = parent.endIncluded('stryker-mocha-test-runner3');21var strykerMochaTestRunner4 = parent.endIncluded('stryker-mocha-test-runner4');22var strykerMochaTestRunner5 = parent.endIncluded('stryker-mocha-test-runner5');23var strykerPhantomJs = parent.endIncluded('stryker-phantomjs');24var strykerPhantomJsRunner = parent.endIncluded('stryker-phantomjs-runner');25var strykerProtractor = parent.endIncluded('stryker-protractor');26var strykerProtractorRunner = parent.endIncluded('stryker-protractor-runner');27var strykerQUnit = parent.endIncluded('stryker-qunit');28var strykerQUnitRunner = parent.endIncluded('stryker-qunit-runner');
Using AI Code Generation
1const strykerParent = require('stryker-parent');2const strykerParent = require('stryker-parent');3strykerParent.endIncluded();4const strykerParent = require('stryker-parent');5const strykerParent = require('stryker-parent');6strykerParent.endIncluded();7const strykerParent = require('stryker-parent');8const strykerParent = require('stryker-parent');9strykerParent.endIncluded();10const strykerParent = require('stryker-parent');11const strykerParent = require('stryker-parent');12strykerParent.endIncluded();13const strykerParent = require('stryker-parent');14const strykerParent = require('stryker-parent');15strykerParent.endIncluded();16const strykerParent = require('stryker-parent');17const strykerParent = require('stryker-parent');18strykerParent.endIncluded();19const strykerParent = require('stryker-parent');20const strykerParent = require('stryker-parent');21strykerParent.endIncluded();22const strykerParent = require('stryker-parent');23const strykerParent = require('stryker-parent');24strykerParent.endIncluded();25const strykerParent = require('stryker-parent');26const strykerParent = require('stryker-parent');27strykerParent.endIncluded();28const strykerParent = require('stryker-parent');29const strykerParent = require('stryker-parent');30strykerParent.endIncluded();31const strykerParent = require('stryker-parent');32const strykerParent = require('stryker-parent');33strykerParent.endIncluded();34const strykerParent = require('stryker-parent');35const strykerParent = require('stryker-parent');
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!!