Best JavaScript code snippet using stryker-parent
HttpError.js
Source:HttpError.js
...54 }); // end it55 it('should return a new BadRequest when given 400', () => {56 unit57 .object(HttpError(400))58 .isInstanceOf(Error)59 .isInstanceOf(HttpError)60 .isInstanceOf(ClientError)61 .isInstanceOf(BadRequest)62 .isEnumerable('code', 400)63 .isEnumerable('status', 'Bad Request')64 .isEnumerable('message', 'Please, correct your request and try again.')65 .isEnumerable('debug')66 .isEnumerable('cause');67 }); // end it68 it('should return a new BadRequest when given "Bad Request"', () => {69 unit70 .object(HttpError('Bad Request'))71 .isInstanceOf(Error)72 .isInstanceOf(HttpError)73 .isInstanceOf(ClientError)74 .isInstanceOf(BadRequest)75 .isEnumerable('code', 400)76 .isEnumerable('status', 'Bad Request')77 .isEnumerable('message', 'Please, correct your request and try again.')78 .isEnumerable('debug')79 .isEnumerable('cause');80 }); // end it81 it('should return a new BadRequest when given "BadRequest"', () => {82 unit83 .object(HttpError('BadRequest'))84 .isInstanceOf(Error)85 .isInstanceOf(HttpError)86 .isInstanceOf(ClientError)87 .isInstanceOf(BadRequest)88 .isEnumerable('code', 400)89 .isEnumerable('status', 'Bad Request')90 .isEnumerable('message', 'Please, correct your request and try again.')91 .isEnumerable('debug')92 .isEnumerable('cause');93 }); // end it94 it('should return a new Unauthorized when given 401', () => {95 unit96 .object(HttpError(401))97 .isInstanceOf(Error)98 .isInstanceOf(HttpError)99 .isInstanceOf(ClientError)100 .isInstanceOf(Unauthorized)101 .isEnumerable('code', 401)102 .isEnumerable('status', 'Unauthorized')103 .isEnumerable('message', 'Please, authenticate and try again.')104 .isEnumerable('debug')105 .isEnumerable('cause');106 }); // end it107 it('should return a new Unauthorized when given "Unauthorized"', () => {108 unit109 .object(HttpError('Unauthorized'))110 .isInstanceOf(Error)111 .isInstanceOf(HttpError)112 .isInstanceOf(ClientError)113 .isInstanceOf(Unauthorized)114 .isEnumerable('code', 401)115 .isEnumerable('status', 'Unauthorized')116 .isEnumerable('message', 'Please, authenticate and try again.')117 .isEnumerable('debug')118 .isEnumerable('cause');119 }); // end it120 it('should return a new Unauthorized when given "Unauthorized"', () => {121 unit122 .object(HttpError('Unauthorized'))123 .isInstanceOf(Error)124 .isInstanceOf(HttpError)125 .isInstanceOf(ClientError)126 .isInstanceOf(Unauthorized)127 .isEnumerable('code', 401)128 .isEnumerable('status', 'Unauthorized')129 .isEnumerable('message', 'Please, authenticate and try again.')130 .isEnumerable('debug')131 .isEnumerable('cause');132 }); // end it133 it('should return a new PaymentRequired when given 402', () => {134 unit135 .object(HttpError(402))136 .isInstanceOf(Error)137 .isInstanceOf(HttpError)138 .isInstanceOf(ClientError)139 .isInstanceOf(PaymentRequired)140 .isEnumerable('code', 402)141 .isEnumerable('status', 'Payment Required')142 .isEnumerable('message', 'Payment is required to use this service.')143 .isEnumerable('debug')144 .isEnumerable('cause');145 }); // end it146 it('should return a new PaymentRequired when given "Payment Required"', () => {147 unit148 .object(HttpError('Payment Required'))149 .isInstanceOf(Error)150 .isInstanceOf(HttpError)151 .isInstanceOf(ClientError)152 .isInstanceOf(PaymentRequired)153 .isEnumerable('code', 402)154 .isEnumerable('status', 'Payment Required')155 .isEnumerable('message', 'Payment is required to use this service.')156 .isEnumerable('debug')157 .isEnumerable('cause');158 }); // end it159 it('should return a new PaymentRequired when given "PaymentRequired"', () => {160 unit161 .object(HttpError('PaymentRequired'))162 .isInstanceOf(Error)163 .isInstanceOf(HttpError)164 .isInstanceOf(ClientError)165 .isInstanceOf(PaymentRequired)166 .isEnumerable('code', 402)167 .isEnumerable('status', 'Payment Required')168 .isEnumerable('message', 'Payment is required to use this service.')169 .isEnumerable('debug')170 .isEnumerable('cause');171 }); // end it172 it('should return a new Forbidden when given 403', () => {173 unit174 .object(HttpError(403))175 .isInstanceOf(Error)176 .isInstanceOf(HttpError)177 .isInstanceOf(ClientError)178 .isInstanceOf(Forbidden)179 .isEnumerable('code', 403)180 .isEnumerable('status', 'Forbidden')181 .isEnumerable('message', 'You lack permission to preform this action.')182 .isEnumerable('debug')183 .isEnumerable('cause');184 }); // end it185 it('should return a new Forbidden when given "Forbidden"', () => {186 unit187 .object(HttpError('Forbidden'))188 .isInstanceOf(Error)189 .isInstanceOf(HttpError)190 .isInstanceOf(ClientError)191 .isInstanceOf(Forbidden)192 .isEnumerable('code', 403)193 .isEnumerable('status', 'Forbidden')194 .isEnumerable('message', 'You lack permission to preform this action.')195 .isEnumerable('debug')196 .isEnumerable('cause');197 }); // end it198 it('should return a new Forbidden when given "Forbidden"', () => {199 unit200 .object(HttpError('Forbidden'))201 .isInstanceOf(Error)202 .isInstanceOf(HttpError)203 .isInstanceOf(ClientError)204 .isInstanceOf(Forbidden)205 .isEnumerable('code', 403)206 .isEnumerable('status', 'Forbidden')207 .isEnumerable('message', 'You lack permission to preform this action.')208 .isEnumerable('debug')209 .isEnumerable('cause');210 }); // end it211 it('should return a new NotFound when given 404', () => {212 unit213 .object(HttpError(404))214 .isInstanceOf(Error)215 .isInstanceOf(HttpError)216 .isInstanceOf(ClientError)217 .isInstanceOf(NotFound)218 .isEnumerable('code', 404)219 .isEnumerable('status', 'Not Found')220 .isEnumerable('message', 'The requested document was not found.')221 .isEnumerable('debug')222 .isEnumerable('cause');223 }); // end it224 it('should return a new NotFound when given "Not Found"', () => {225 unit226 .object(HttpError('Not Found'))227 .isInstanceOf(Error)228 .isInstanceOf(HttpError)229 .isInstanceOf(ClientError)230 .isInstanceOf(NotFound)231 .isEnumerable('code', 404)232 .isEnumerable('status', 'Not Found')233 .isEnumerable('message', 'The requested document was not found.')234 .isEnumerable('debug')235 .isEnumerable('cause');236 }); // end it237 it('should return a new NotFound when given "NotFound"', () => {238 unit239 .object(HttpError('NotFound'))240 .isInstanceOf(Error)241 .isInstanceOf(HttpError)242 .isInstanceOf(ClientError)243 .isInstanceOf(NotFound)244 .isEnumerable('code', 404)245 .isEnumerable('status', 'Not Found')246 .isEnumerable('message', 'The requested document was not found.')247 .isEnumerable('debug')248 .isEnumerable('cause');249 }); // end it250 it('should return a new MethodNotAllowed when given 405', () => {251 unit252 .object(HttpError(405))253 .isInstanceOf(Error)254 .isInstanceOf(HttpError)255 .isInstanceOf(ClientError)256 .isInstanceOf(MethodNotAllowed)257 .isEnumerable('code', 405)258 .isEnumerable('status', 'Method Not Allowed')259 .isEnumerable('message', 'Please, check your request method and try again.')260 .isEnumerable('debug')261 .isEnumerable('cause');262 }); // end it263 it('should return a new MethodNotAllowed when given "Method Not Allowed"', () => {264 unit265 .object(HttpError('Method Not Allowed'))266 .isInstanceOf(Error)267 .isInstanceOf(HttpError)268 .isInstanceOf(ClientError)269 .isInstanceOf(MethodNotAllowed)270 .isEnumerable('code', 405)271 .isEnumerable('status', 'Method Not Allowed')272 .isEnumerable('message', 'Please, check your request method and try again.')273 .isEnumerable('debug')274 .isEnumerable('cause');275 }); // end it276 it('should return a new MethodNotAllowed when given "MethodNotAllowed"', () => {277 unit278 .object(HttpError('MethodNotAllowed'))279 .isInstanceOf(Error)280 .isInstanceOf(HttpError)281 .isInstanceOf(ClientError)282 .isInstanceOf(MethodNotAllowed)283 .isEnumerable('code', 405)284 .isEnumerable('status', 'Method Not Allowed')285 .isEnumerable('message', 'Please, check your request method and try again.')286 .isEnumerable('debug')287 .isEnumerable('cause');288 }); // end it289 it('should return a new NotAcceptable when given 406', () => {290 unit291 .object(HttpError(406))292 .isInstanceOf(Error)293 .isInstanceOf(HttpError)294 .isInstanceOf(ClientError)295 .isInstanceOf(NotAcceptable)296 .isEnumerable('code', 406)297 .isEnumerable('status', 'Not Acceptable')298 .isEnumerable('message', 'The requested document format is not supported.')299 .isEnumerable('debug')300 .isEnumerable('cause');301 }); // end it302 it('should return a new NotAcceptable when given "Not Acceptable"', () => {303 unit304 .object(HttpError('Not Acceptable'))305 .isInstanceOf(Error)306 .isInstanceOf(HttpError)307 .isInstanceOf(ClientError)308 .isInstanceOf(NotAcceptable)309 .isEnumerable('code', 406)310 .isEnumerable('status', 'Not Acceptable')311 .isEnumerable('message', 'The requested document format is not supported.')312 .isEnumerable('debug')313 .isEnumerable('cause');314 }); // end it315 it('should return a new NotAcceptable when given "NotAcceptable"', () => {316 unit317 .object(HttpError('NotAcceptable'))318 .isInstanceOf(Error)319 .isInstanceOf(HttpError)320 .isInstanceOf(ClientError)321 .isInstanceOf(NotAcceptable)322 .isEnumerable('code', 406)323 .isEnumerable('status', 'Not Acceptable')324 .isEnumerable('message', 'The requested document format is not supported.')325 .isEnumerable('debug')326 .isEnumerable('cause');327 }); // end it328 it('should return a new ProxyAuthenticationRequired when given 407', () => {329 unit330 .object(HttpError(407))331 .isInstanceOf(Error)332 .isInstanceOf(HttpError)333 .isInstanceOf(ClientError)334 .isInstanceOf(ProxyAuthenticationRequired)335 .isEnumerable('code', 407)336 .isEnumerable('status', 'Proxy Authentication Required')337 .isEnumerable('message', 'Please, authenticate with the proxy server and try again.')338 .isEnumerable('debug')339 .isEnumerable('cause');340 }); // end it341 it('should return a new ProxyAuthenticationRequired when given "Proxy Authentication Required"', () => {342 unit343 .object(HttpError('Proxy Authentication Required'))344 .isInstanceOf(Error)345 .isInstanceOf(HttpError)346 .isInstanceOf(ClientError)347 .isInstanceOf(ProxyAuthenticationRequired)348 .isEnumerable('code', 407)349 .isEnumerable('status', 'Proxy Authentication Required')350 .isEnumerable('message', 'Please, authenticate with the proxy server and try again.')351 .isEnumerable('debug')352 .isEnumerable('cause');353 }); // end it354 it('should return a new ProxyAuthenticationRequired when given "ProxyAuthenticationRequired"', () => {355 unit356 .object(HttpError('ProxyAuthenticationRequired'))357 .isInstanceOf(Error)358 .isInstanceOf(HttpError)359 .isInstanceOf(ClientError)360 .isInstanceOf(ProxyAuthenticationRequired)361 .isEnumerable('code', 407)362 .isEnumerable('status', 'Proxy Authentication Required')363 .isEnumerable('message', 'Please, authenticate with the proxy server and try again.')364 .isEnumerable('debug')365 .isEnumerable('cause');366 }); // end it367 it('should return a new RequestTimeout when given 408', () => {368 unit369 .object(HttpError(408))370 .isInstanceOf(Error)371 .isInstanceOf(HttpError)372 .isInstanceOf(ClientError)373 .isInstanceOf(RequestTimeout)374 .isEnumerable('code', 408)375 .isEnumerable('status', 'Request Timeout')376 .isEnumerable('message', 'Sorry, it appears we are on break, please try again later.')377 .isEnumerable('debug')378 .isEnumerable('cause');379 }); // end it380 it('should return a new RequestTimeout when given "Request Timeout"', () => {381 unit382 .object(HttpError('Request Timeout'))383 .isInstanceOf(Error)384 .isInstanceOf(HttpError)385 .isInstanceOf(ClientError)386 .isInstanceOf(RequestTimeout)387 .isEnumerable('code', 408)388 .isEnumerable('status', 'Request Timeout')389 .isEnumerable('message', 'Sorry, it appears we are on break, please try again later.')390 .isEnumerable('debug')391 .isEnumerable('cause');392 }); // end it393 it('should return a new RequestTimeout when given "RequestTimeout"', () => {394 unit395 .object(HttpError('RequestTimeout'))396 .isInstanceOf(Error)397 .isInstanceOf(HttpError)398 .isInstanceOf(ClientError)399 .isInstanceOf(RequestTimeout)400 .isEnumerable('code', 408)401 .isEnumerable('status', 'Request Timeout')402 .isEnumerable('message', 'Sorry, it appears we are on break, please try again later.')403 .isEnumerable('debug')404 .isEnumerable('cause');405 }); // end it406 it('should return a new Conflict when given 409', () => {407 unit408 .object(HttpError(409))409 .isInstanceOf(Error)410 .isInstanceOf(HttpError)411 .isInstanceOf(ClientError)412 .isInstanceOf(Conflict)413 .isEnumerable('code', 409)414 .isEnumerable('status', 'Conflict')415 .isEnumerable('message', 'Houston, we have a conflict, please reload the resource and try again.')416 .isEnumerable('debug')417 .isEnumerable('cause');418 }); // end it419 it('should return a new Conflict when given "Conflict"', () => {420 unit421 .object(HttpError('Conflict'))422 .isInstanceOf(Error)423 .isInstanceOf(HttpError)424 .isInstanceOf(ClientError)425 .isInstanceOf(Conflict)426 .isEnumerable('code', 409)427 .isEnumerable('status', 'Conflict')428 .isEnumerable('message', 'Houston, we have a conflict, please reload the resource and try again.')429 .isEnumerable('debug')430 .isEnumerable('cause');431 }); // end it432 it('should return a new Conflict when given "Conflict"', () => {433 unit434 .object(HttpError('Conflict'))435 .isInstanceOf(Error)436 .isInstanceOf(HttpError)437 .isInstanceOf(ClientError)438 .isInstanceOf(Conflict)439 .isEnumerable('code', 409)440 .isEnumerable('status', 'Conflict')441 .isEnumerable('message', 'Houston, we have a conflict, please reload the resource and try again.')442 .isEnumerable('debug')443 .isEnumerable('cause');444 }); // end it445 it('should return a new Gone when given 410', () => {446 unit447 .object(HttpError(410))448 .isInstanceOf(Error)449 .isInstanceOf(HttpError)450 .isInstanceOf(ClientError)451 .isInstanceOf(Gone)452 .isEnumerable('code', 410)453 .isEnumerable('status', 'Gone')454 .isEnumerable('message', 'Sorry, but that resource has been removed.')455 .isEnumerable('debug')456 .isEnumerable('cause');457 }); // end it458 it('should return a new Gone when given "Gone"', () => {459 unit460 .object(HttpError('Gone'))461 .isInstanceOf(Error)462 .isInstanceOf(HttpError)463 .isInstanceOf(ClientError)464 .isInstanceOf(Gone)465 .isEnumerable('code', 410)466 .isEnumerable('status', 'Gone')467 .isEnumerable('message', 'Sorry, but that resource has been removed.')468 .isEnumerable('debug')469 .isEnumerable('cause');470 }); // end it471 it('should return a new Gone when given "Gone"', () => {472 unit473 .object(HttpError('Gone'))474 .isInstanceOf(Error)475 .isInstanceOf(HttpError)476 .isInstanceOf(ClientError)477 .isInstanceOf(Gone)478 .isEnumerable('code', 410)479 .isEnumerable('status', 'Gone')480 .isEnumerable('message', 'Sorry, but that resource has been removed.')481 .isEnumerable('debug')482 .isEnumerable('cause');483 }); // end it484 it('should return a new LengthRequired when given 411', () => {485 unit486 .object(HttpError(411))487 .isInstanceOf(Error)488 .isInstanceOf(HttpError)489 .isInstanceOf(ClientError)490 .isInstanceOf(LengthRequired)491 .isEnumerable('code', 411)492 .isEnumerable('status', 'Length Required')493 .isEnumerable('message', 'Please, correct the Length header and try again.')494 .isEnumerable('debug')495 .isEnumerable('cause');496 }); // end it497 it('should return a new LengthRequired when given "Length Required"', () => {498 unit499 .object(HttpError('Length Required'))500 .isInstanceOf(Error)501 .isInstanceOf(HttpError)502 .isInstanceOf(ClientError)503 .isInstanceOf(LengthRequired)504 .isEnumerable('code', 411)505 .isEnumerable('status', 'Length Required')506 .isEnumerable('message', 'Please, correct the Length header and try again.')507 .isEnumerable('debug')508 .isEnumerable('cause');509 }); // end it510 it('should return a new LengthRequired when given "LengthRequired"', () => {511 unit512 .object(HttpError('LengthRequired'))513 .isInstanceOf(Error)514 .isInstanceOf(HttpError)515 .isInstanceOf(ClientError)516 .isInstanceOf(LengthRequired)517 .isEnumerable('code', 411)518 .isEnumerable('status', 'Length Required')519 .isEnumerable('message', 'Please, correct the Length header and try again.')520 .isEnumerable('debug')521 .isEnumerable('cause');522 }); // end it523 it('should return a new PreconditionFailed when given 412', () => {524 unit525 .object(HttpError(412))526 .isInstanceOf(Error)527 .isInstanceOf(HttpError)528 .isInstanceOf(ClientError)529 .isInstanceOf(PreconditionFailed)530 .isEnumerable('code', 412)531 .isEnumerable('status', 'Precondition Failed')532 .isEnumerable('message', 'Sorry, it appears 1 or more preconditions on the request have changed, please correct and try again.')533 .isEnumerable('debug')534 .isEnumerable('cause');535 }); // end it536 it('should return a new PreconditionFailed when given "Precondition Failed"', () => {537 unit538 .object(HttpError('Precondition Failed'))539 .isInstanceOf(Error)540 .isInstanceOf(HttpError)541 .isInstanceOf(ClientError)542 .isInstanceOf(PreconditionFailed)543 .isEnumerable('code', 412)544 .isEnumerable('status', 'Precondition Failed')545 .isEnumerable('message', 'Sorry, it appears 1 or more preconditions on the request have changed, please correct and try again.')546 .isEnumerable('debug')547 .isEnumerable('cause');548 }); // end it549 it('should return a new PreconditionFailed when given "PreconditionFailed"', () => {550 unit551 .object(HttpError('PreconditionFailed'))552 .isInstanceOf(Error)553 .isInstanceOf(HttpError)554 .isInstanceOf(ClientError)555 .isInstanceOf(PreconditionFailed)556 .isEnumerable('code', 412)557 .isEnumerable('status', 'Precondition Failed')558 .isEnumerable('message', 'Sorry, it appears 1 or more preconditions on the request have changed, please correct and try again.')559 .isEnumerable('debug')560 .isEnumerable('cause');561 }); // end it562 it('should return a new PayloadTooLarge when given 413', () => {563 unit564 .object(HttpError(413))565 .isInstanceOf(Error)566 .isInstanceOf(HttpError)567 .isInstanceOf(ClientError)568 .isInstanceOf(PayloadTooLarge)569 .isEnumerable('code', 413)570 .isEnumerable('status', 'Payload Too Large')571 .isEnumerable('message', 'Request payload is too large and can not be processed.')572 .isEnumerable('debug')573 .isEnumerable('cause');574 }); // end it575 it('should return a new PayloadTooLarge when given "Payload Too Large"', () => {576 unit577 .object(HttpError('Payload Too Large'))578 .isInstanceOf(Error)579 .isInstanceOf(HttpError)580 .isInstanceOf(ClientError)581 .isInstanceOf(PayloadTooLarge)582 .isEnumerable('code', 413)583 .isEnumerable('status', 'Payload Too Large')584 .isEnumerable('message', 'Request payload is too large and can not be processed.')585 .isEnumerable('debug')586 .isEnumerable('cause');587 }); // end it588 it('should return a new PayloadTooLarge when given "PayloadTooLarge"', () => {589 unit590 .object(HttpError('PayloadTooLarge'))591 .isInstanceOf(Error)592 .isInstanceOf(HttpError)593 .isInstanceOf(ClientError)594 .isInstanceOf(PayloadTooLarge)595 .isEnumerable('code', 413)596 .isEnumerable('status', 'Payload Too Large')597 .isEnumerable('message', 'Request payload is too large and can not be processed.')598 .isEnumerable('debug')599 .isEnumerable('cause');600 }); // end it601 it('should return a new URITooLong when given 414', () => {602 unit603 .object(HttpError(414))604 .isInstanceOf(Error)605 .isInstanceOf(HttpError)606 .isInstanceOf(ClientError)607 .isInstanceOf(URITooLong)608 .isEnumerable('code', 414)609 .isEnumerable('status', 'URI Too Long')610 .isEnumerable('message', 'Request uri is too large and can not be processed.')611 .isEnumerable('debug')612 .isEnumerable('cause');613 }); // end it614 it('should return a new URITooLong when given "URI Too Long"', () => {615 unit616 .object(HttpError('URI Too Long'))617 .isInstanceOf(Error)618 .isInstanceOf(HttpError)619 .isInstanceOf(ClientError)620 .isInstanceOf(URITooLong)621 .isEnumerable('code', 414)622 .isEnumerable('status', 'URI Too Long')623 .isEnumerable('message', 'Request uri is too large and can not be processed.')624 .isEnumerable('debug')625 .isEnumerable('cause');626 }); // end it627 it('should return a new URITooLong when given "URITooLong"', () => {628 unit629 .object(HttpError('URITooLong'))630 .isInstanceOf(Error)631 .isInstanceOf(HttpError)632 .isInstanceOf(ClientError)633 .isInstanceOf(URITooLong)634 .isEnumerable('code', 414)635 .isEnumerable('status', 'URI Too Long')636 .isEnumerable('message', 'Request uri is too large and can not be processed.')637 .isEnumerable('debug')638 .isEnumerable('cause');639 }); // end it640 it('should return a new UnsupportedMediaType when given 415', () => {641 unit642 .object(HttpError(415))643 .isInstanceOf(Error)644 .isInstanceOf(HttpError)645 .isInstanceOf(ClientError)646 .isInstanceOf(UnsupportedMediaType)647 .isEnumerable('code', 415)648 .isEnumerable('status', 'Unsupported Media Type')649 .isEnumerable('message', 'Please, try again with a different media format.')650 .isEnumerable('debug')651 .isEnumerable('cause');652 }); // end it653 it('should return a new UnsupportedMediaType when given "Unsupported Media Type"', () => {654 unit655 .object(HttpError('Unsupported Media Type'))656 .isInstanceOf(Error)657 .isInstanceOf(HttpError)658 .isInstanceOf(ClientError)659 .isInstanceOf(UnsupportedMediaType)660 .isEnumerable('code', 415)661 .isEnumerable('status', 'Unsupported Media Type')662 .isEnumerable('message', 'Please, try again with a different media format.')663 .isEnumerable('debug')664 .isEnumerable('cause');665 }); // end it666 it('should return a new UnsupportedMediaType when given "UnsupportedMediaType"', () => {667 unit668 .object(HttpError('UnsupportedMediaType'))669 .isInstanceOf(Error)670 .isInstanceOf(HttpError)671 .isInstanceOf(ClientError)672 .isInstanceOf(UnsupportedMediaType)673 .isEnumerable('code', 415)674 .isEnumerable('status', 'Unsupported Media Type')675 .isEnumerable('message', 'Please, try again with a different media format.')676 .isEnumerable('debug')677 .isEnumerable('cause');678 }); // end it679 it('should return a new RangeNotSatisfiable when given 416', () => {680 unit681 .object(HttpError(416))682 .isInstanceOf(Error)683 .isInstanceOf(HttpError)684 .isInstanceOf(ClientError)685 .isInstanceOf(RangeNotSatisfiable)686 .isEnumerable('code', 416)687 .isEnumerable('status', 'Range Not Satisfiable')688 .isEnumerable('message', 'Requested range is not satisfiable, please check Range and try again.')689 .isEnumerable('debug')690 .isEnumerable('cause');691 }); // end it692 it('should return a new RangeNotSatisfiable when given "Range Not Satisfiable"', () => {693 unit694 .object(HttpError('Range Not Satisfiable'))695 .isInstanceOf(Error)696 .isInstanceOf(HttpError)697 .isInstanceOf(ClientError)698 .isInstanceOf(RangeNotSatisfiable)699 .isEnumerable('code', 416)700 .isEnumerable('status', 'Range Not Satisfiable')701 .isEnumerable('message', 'Requested range is not satisfiable, please check Range and try again.')702 .isEnumerable('debug')703 .isEnumerable('cause');704 }); // end it705 it('should return a new RangeNotSatisfiable when given "RangeNotSatisfiable"', () => {706 unit707 .object(HttpError('RangeNotSatisfiable'))708 .isInstanceOf(Error)709 .isInstanceOf(HttpError)710 .isInstanceOf(ClientError)711 .isInstanceOf(RangeNotSatisfiable)712 .isEnumerable('code', 416)713 .isEnumerable('status', 'Range Not Satisfiable')714 .isEnumerable('message', 'Requested range is not satisfiable, please check Range and try again.')715 .isEnumerable('debug')716 .isEnumerable('cause');717 }); // end it718 it('should return a new ExpectationFailed when given 417', () => {719 unit720 .object(HttpError(417))721 .isInstanceOf(Error)722 .isInstanceOf(HttpError)723 .isInstanceOf(ClientError)724 .isInstanceOf(ExpectationFailed)725 .isEnumerable('code', 417)726 .isEnumerable('status', 'Expectation Failed')727 .isEnumerable('message', 'Sorry, your expectation can not be meet, please check Expect and try again.')728 .isEnumerable('debug')729 .isEnumerable('cause');730 }); // end it731 it('should return a new ExpectationFailed when given "Expectation Failed"', () => {732 unit733 .object(HttpError('Expectation Failed'))734 .isInstanceOf(Error)735 .isInstanceOf(HttpError)736 .isInstanceOf(ClientError)737 .isInstanceOf(ExpectationFailed)738 .isEnumerable('code', 417)739 .isEnumerable('status', 'Expectation Failed')740 .isEnumerable('message', 'Sorry, your expectation can not be meet, please check Expect and try again.')741 .isEnumerable('debug')742 .isEnumerable('cause');743 }); // end it744 it('should return a new ExpectationFailed when given "ExpectationFailed"', () => {745 unit746 .object(HttpError('ExpectationFailed'))747 .isInstanceOf(Error)748 .isInstanceOf(HttpError)749 .isInstanceOf(ClientError)750 .isInstanceOf(ExpectationFailed)751 .isEnumerable('code', 417)752 .isEnumerable('status', 'Expectation Failed')753 .isEnumerable('message', 'Sorry, your expectation can not be meet, please check Expect and try again.')754 .isEnumerable('debug')755 .isEnumerable('cause');756 }); // end it757 it('should return a new IMATeapot when given 418', () => {758 unit759 .object(HttpError(418))760 .isInstanceOf(Error)761 .isInstanceOf(HttpError)762 .isInstanceOf(ClientError)763 .isInstanceOf(IMATeapot)764 .isEnumerable('code', 418)765 .isEnumerable('status', 'I\'m a teapot')766 .isEnumerable('message', 'Tip me over, and pour me out.')767 .isEnumerable('debug')768 .isEnumerable('cause');769 }); // end it770 it('should return a new IMATeapot when given "I\'m a teapot"', () => {771 unit772 .object(HttpError('I\'m a teapot'))773 .isInstanceOf(Error)774 .isInstanceOf(HttpError)775 .isInstanceOf(ClientError)776 .isInstanceOf(IMATeapot)777 .isEnumerable('code', 418)778 .isEnumerable('status', 'I\'m a teapot')779 .isEnumerable('message', 'Tip me over, and pour me out.')780 .isEnumerable('debug')781 .isEnumerable('cause');782 }); // end it783 it('should return a new IMATeapot when given "IMATeapot"', () => {784 unit785 .object(HttpError('IMATeapot'))786 .isInstanceOf(Error)787 .isInstanceOf(HttpError)788 .isInstanceOf(ClientError)789 .isInstanceOf(IMATeapot)790 .isEnumerable('code', 418)791 .isEnumerable('status', 'I\'m a teapot')792 .isEnumerable('message', 'Tip me over, and pour me out.')793 .isEnumerable('debug')794 .isEnumerable('cause');795 }); // end it796 it('should return a new MisdirectedRequest when given 421', () => {797 unit798 .object(HttpError(421))799 .isInstanceOf(Error)800 .isInstanceOf(HttpError)801 .isInstanceOf(ClientError)802 .isInstanceOf(MisdirectedRequest)803 .isEnumerable('code', 421)804 .isEnumerable('status', 'Misdirected Request')805 .isEnumerable('message', 'Sorry, we got misdirected, please try again later.')806 .isEnumerable('debug')807 .isEnumerable('cause');808 }); // end it809 it('should return a new MisdirectedRequest when given "Misdirected Request"', () => {810 unit811 .object(HttpError('Misdirected Request'))812 .isInstanceOf(Error)813 .isInstanceOf(HttpError)814 .isInstanceOf(ClientError)815 .isInstanceOf(MisdirectedRequest)816 .isEnumerable('code', 421)817 .isEnumerable('status', 'Misdirected Request')818 .isEnumerable('message', 'Sorry, we got misdirected, please try again later.')819 .isEnumerable('debug')820 .isEnumerable('cause');821 }); // end it822 it('should return a new MisdirectedRequest when given "MisdirectedRequest"', () => {823 unit824 .object(HttpError('MisdirectedRequest'))825 .isInstanceOf(Error)826 .isInstanceOf(HttpError)827 .isInstanceOf(ClientError)828 .isInstanceOf(MisdirectedRequest)829 .isEnumerable('code', 421)830 .isEnumerable('status', 'Misdirected Request')831 .isEnumerable('message', 'Sorry, we got misdirected, please try again later.')832 .isEnumerable('debug')833 .isEnumerable('cause');834 }); // end it835 it('should return a new UnprocessableEntity when given 422', () => {836 unit837 .object(HttpError(422))838 .isInstanceOf(Error)839 .isInstanceOf(HttpError)840 .isInstanceOf(ClientError)841 .isInstanceOf(UnprocessableEntity)842 .isEnumerable('code', 422)843 .isEnumerable('status', 'Unprocessable Entity')844 .isEnumerable('message', 'Sorry, it appears your document instructions are semantically erroneous.')845 .isEnumerable('debug')846 .isEnumerable('cause');847 }); // end it848 it('should return a new UnprocessableEntity when given "Unprocessable Entity"', () => {849 unit850 .object(HttpError('Unprocessable Entity'))851 .isInstanceOf(Error)852 .isInstanceOf(HttpError)853 .isInstanceOf(ClientError)854 .isInstanceOf(UnprocessableEntity)855 .isEnumerable('code', 422)856 .isEnumerable('status', 'Unprocessable Entity')857 .isEnumerable('message', 'Sorry, it appears your document instructions are semantically erroneous.')858 .isEnumerable('debug')859 .isEnumerable('cause');860 }); // end it861 it('should return a new UnprocessableEntity when given "UnprocessableEntity"', () => {862 unit863 .object(HttpError('UnprocessableEntity'))864 .isInstanceOf(Error)865 .isInstanceOf(HttpError)866 .isInstanceOf(ClientError)867 .isInstanceOf(UnprocessableEntity)868 .isEnumerable('code', 422)869 .isEnumerable('status', 'Unprocessable Entity')870 .isEnumerable('message', 'Sorry, it appears your document instructions are semantically erroneous.')871 .isEnumerable('debug')872 .isEnumerable('cause');873 }); // end it874 it('should return a new Locked when given 423', () => {875 unit876 .object(HttpError(423))877 .isInstanceOf(Error)878 .isInstanceOf(HttpError)879 .isInstanceOf(ClientError)880 .isInstanceOf(Locked)881 .isEnumerable('code', 423)882 .isEnumerable('status', 'Locked')883 .isEnumerable('message', 'Document is currently locked, please try again later.')884 .isEnumerable('debug')885 .isEnumerable('cause');886 }); // end it887 it('should return a new Locked when given "Locked"', () => {888 unit889 .object(HttpError('Locked'))890 .isInstanceOf(Error)891 .isInstanceOf(HttpError)892 .isInstanceOf(ClientError)893 .isInstanceOf(Locked)894 .isEnumerable('code', 423)895 .isEnumerable('status', 'Locked')896 .isEnumerable('message', 'Document is currently locked, please try again later.')897 .isEnumerable('debug')898 .isEnumerable('cause');899 }); // end it900 it('should return a new Locked when given "Locked"', () => {901 unit902 .object(HttpError('Locked'))903 .isInstanceOf(Error)904 .isInstanceOf(HttpError)905 .isInstanceOf(ClientError)906 .isInstanceOf(Locked)907 .isEnumerable('code', 423)908 .isEnumerable('status', 'Locked')909 .isEnumerable('message', 'Document is currently locked, please try again later.')910 .isEnumerable('debug')911 .isEnumerable('cause');912 }); // end it913 it('should return a new FailedDependency when given 424', () => {914 unit915 .object(HttpError(424))916 .isInstanceOf(Error)917 .isInstanceOf(HttpError)918 .isInstanceOf(ClientError)919 .isInstanceOf(FailedDependency)920 .isEnumerable('code', 424)921 .isEnumerable('status', 'Failed Dependency')922 .isEnumerable('message', 'Sorry, it appears a dependent request has failed please retry previous dependent request and try again.')923 .isEnumerable('debug')924 .isEnumerable('cause');925 }); // end it926 it('should return a new FailedDependency when given "Failed Dependency"', () => {927 unit928 .object(HttpError('Failed Dependency'))929 .isInstanceOf(Error)930 .isInstanceOf(HttpError)931 .isInstanceOf(ClientError)932 .isInstanceOf(FailedDependency)933 .isEnumerable('code', 424)934 .isEnumerable('status', 'Failed Dependency')935 .isEnumerable('message', 'Sorry, it appears a dependent request has failed please retry previous dependent request and try again.')936 .isEnumerable('debug')937 .isEnumerable('cause');938 }); // end it939 it('should return a new FailedDependency when given "FailedDependency"', () => {940 unit941 .object(HttpError('FailedDependency'))942 .isInstanceOf(Error)943 .isInstanceOf(HttpError)944 .isInstanceOf(ClientError)945 .isInstanceOf(FailedDependency)946 .isEnumerable('code', 424)947 .isEnumerable('status', 'Failed Dependency')948 .isEnumerable('message', 'Sorry, it appears a dependent request has failed please retry previous dependent request and try again.')949 .isEnumerable('debug')950 .isEnumerable('cause');951 }); // end it952 it('should return a new UpgradeRequired when given 426', () => {953 unit954 .object(HttpError(426))955 .isInstanceOf(Error)956 .isInstanceOf(HttpError)957 .isInstanceOf(ClientError)958 .isInstanceOf(UpgradeRequired)959 .isEnumerable('code', 426)960 .isEnumerable('status', 'Upgrade Required')961 .isEnumerable('message', 'Please, upgrade and try again.')962 .isEnumerable('debug')963 .isEnumerable('cause');964 }); // end it965 it('should return a new UpgradeRequired when given "Upgrade Required"', () => {966 unit967 .object(HttpError('Upgrade Required'))968 .isInstanceOf(Error)969 .isInstanceOf(HttpError)970 .isInstanceOf(ClientError)971 .isInstanceOf(UpgradeRequired)972 .isEnumerable('code', 426)973 .isEnumerable('status', 'Upgrade Required')974 .isEnumerable('message', 'Please, upgrade and try again.')975 .isEnumerable('debug')976 .isEnumerable('cause');977 }); // end it978 it('should return a new UpgradeRequired when given "UpgradeRequired"', () => {979 unit980 .object(HttpError('UpgradeRequired'))981 .isInstanceOf(Error)982 .isInstanceOf(HttpError)983 .isInstanceOf(ClientError)984 .isInstanceOf(UpgradeRequired)985 .isEnumerable('code', 426)986 .isEnumerable('status', 'Upgrade Required')987 .isEnumerable('message', 'Please, upgrade and try again.')988 .isEnumerable('debug')989 .isEnumerable('cause');990 }); // end it991 it('should return a new PreconditionRequired when given 428', () => {992 unit993 .object(HttpError(428))994 .isInstanceOf(Error)995 .isInstanceOf(HttpError)996 .isInstanceOf(ClientError)997 .isInstanceOf(PreconditionRequired)998 .isEnumerable('code', 428)999 .isEnumerable('status', 'Precondition Required')1000 .isEnumerable('message', 'Please, add preconditions to your request and try again.')1001 .isEnumerable('debug')1002 .isEnumerable('cause');1003 }); // end it1004 it('should return a new PreconditionRequired when given "Precondition Required"', () => {1005 unit1006 .object(HttpError('Precondition Required'))1007 .isInstanceOf(Error)1008 .isInstanceOf(HttpError)1009 .isInstanceOf(ClientError)1010 .isInstanceOf(PreconditionRequired)1011 .isEnumerable('code', 428)1012 .isEnumerable('status', 'Precondition Required')1013 .isEnumerable('message', 'Please, add preconditions to your request and try again.')1014 .isEnumerable('debug')1015 .isEnumerable('cause');1016 }); // end it1017 it('should return a new PreconditionRequired when given "PreconditionRequired"', () => {1018 unit1019 .object(HttpError('PreconditionRequired'))1020 .isInstanceOf(Error)1021 .isInstanceOf(HttpError)1022 .isInstanceOf(ClientError)1023 .isInstanceOf(PreconditionRequired)1024 .isEnumerable('code', 428)1025 .isEnumerable('status', 'Precondition Required')1026 .isEnumerable('message', 'Please, add preconditions to your request and try again.')1027 .isEnumerable('debug')1028 .isEnumerable('cause');1029 }); // end it1030 it('should return a new TooManyRequests when given 429', () => {1031 unit1032 .object(HttpError(429))1033 .isInstanceOf(Error)1034 .isInstanceOf(HttpError)1035 .isInstanceOf(ClientError)1036 .isInstanceOf(TooManyRequests)1037 .isEnumerable('code', 429)1038 .isEnumerable('status', 'Too Many Requests')1039 .isEnumerable('message', 'Sorry, you have exceeded your rate limit, please try again later.')1040 .isEnumerable('debug')1041 .isEnumerable('cause');1042 }); // end it1043 it('should return a new TooManyRequests when given "Too Many Requests"', () => {1044 unit1045 .object(HttpError('Too Many Requests'))1046 .isInstanceOf(Error)1047 .isInstanceOf(HttpError)1048 .isInstanceOf(ClientError)1049 .isInstanceOf(TooManyRequests)1050 .isEnumerable('code', 429)1051 .isEnumerable('status', 'Too Many Requests')1052 .isEnumerable('message', 'Sorry, you have exceeded your rate limit, please try again later.')1053 .isEnumerable('debug')1054 .isEnumerable('cause');1055 }); // end it1056 it('should return a new TooManyRequests when given "TooManyRequests"', () => {1057 unit1058 .object(HttpError('TooManyRequests'))1059 .isInstanceOf(Error)1060 .isInstanceOf(HttpError)1061 .isInstanceOf(ClientError)1062 .isInstanceOf(TooManyRequests)1063 .isEnumerable('code', 429)1064 .isEnumerable('status', 'Too Many Requests')1065 .isEnumerable('message', 'Sorry, you have exceeded your rate limit, please try again later.')1066 .isEnumerable('debug')1067 .isEnumerable('cause');1068 }); // end it1069 it('should return a new RequestHeaderFieldsTooLarge when given 431', () => {1070 unit1071 .object(HttpError(431))1072 .isInstanceOf(Error)1073 .isInstanceOf(HttpError)1074 .isInstanceOf(ClientError)1075 .isInstanceOf(RequestHeaderFieldsTooLarge)1076 .isEnumerable('code', 431)1077 .isEnumerable('status', 'Request Header Fields Too Large')1078 .isEnumerable('message', 'Request header is too large and can not be processed.')1079 .isEnumerable('debug')1080 .isEnumerable('cause');1081 }); // end it1082 it('should return a new RequestHeaderFieldsTooLarge when given "Request Header Fields Too Large"', () => {1083 unit1084 .object(HttpError('Request Header Fields Too Large'))1085 .isInstanceOf(Error)1086 .isInstanceOf(HttpError)1087 .isInstanceOf(ClientError)1088 .isInstanceOf(RequestHeaderFieldsTooLarge)1089 .isEnumerable('code', 431)1090 .isEnumerable('status', 'Request Header Fields Too Large')1091 .isEnumerable('message', 'Request header is too large and can not be processed.')1092 .isEnumerable('debug')1093 .isEnumerable('cause');1094 }); // end it1095 it('should return a new RequestHeaderFieldsTooLarge when given "RequestHeaderFieldsTooLarge"', () => {1096 unit1097 .object(HttpError('RequestHeaderFieldsTooLarge'))1098 .isInstanceOf(Error)1099 .isInstanceOf(HttpError)1100 .isInstanceOf(ClientError)1101 .isInstanceOf(RequestHeaderFieldsTooLarge)1102 .isEnumerable('code', 431)1103 .isEnumerable('status', 'Request Header Fields Too Large')1104 .isEnumerable('message', 'Request header is too large and can not be processed.')1105 .isEnumerable('debug')1106 .isEnumerable('cause');1107 }); // end it1108 it('should return a new UnavailableForLegalReasons when given 451', () => {1109 unit1110 .object(HttpError(451))1111 .isInstanceOf(Error)1112 .isInstanceOf(HttpError)1113 .isInstanceOf(ClientError)1114 .isInstanceOf(UnavailableForLegalReasons)1115 .isEnumerable('code', 451)1116 .isEnumerable('status', 'Unavailable For Legal Reasons')1117 .isEnumerable('message', 'Due to legal reasons this resource has been removed.')1118 .isEnumerable('debug')1119 .isEnumerable('cause');1120 }); // end it1121 it('should return a new UnavailableForLegalReasons when given "Unavailable For Legal Reasons"', () => {1122 unit1123 .object(HttpError('Unavailable For Legal Reasons'))1124 .isInstanceOf(Error)1125 .isInstanceOf(HttpError)1126 .isInstanceOf(ClientError)1127 .isInstanceOf(UnavailableForLegalReasons)1128 .isEnumerable('code', 451)1129 .isEnumerable('status', 'Unavailable For Legal Reasons')1130 .isEnumerable('message', 'Due to legal reasons this resource has been removed.')1131 .isEnumerable('debug')1132 .isEnumerable('cause');1133 }); // end it1134 it('should return a new UnavailableForLegalReasons when given "UnavailableForLegalReasons"', () => {1135 unit1136 .object(HttpError('UnavailableForLegalReasons'))1137 .isInstanceOf(Error)1138 .isInstanceOf(HttpError)1139 .isInstanceOf(ClientError)1140 .isInstanceOf(UnavailableForLegalReasons)1141 .isEnumerable('code', 451)1142 .isEnumerable('status', 'Unavailable For Legal Reasons')1143 .isEnumerable('message', 'Due to legal reasons this resource has been removed.')1144 .isEnumerable('debug')1145 .isEnumerable('cause');1146 }); // end it1147 it('should return a new InternalServerError when given 500', () => {1148 unit1149 .object(HttpError(500))1150 .isInstanceOf(Error)1151 .isInstanceOf(HttpError)1152 .isInstanceOf(ServerError)1153 .isInstanceOf(InternalServerError)1154 .isEnumerable('code', 500)1155 .isEnumerable('status', 'Internal Server Error')1156 .isEnumerable('message', 'Sorry, it appears we had an unexpected error, please try again.')1157 .isEnumerable('debug')1158 .isEnumerable('cause');1159 }); // end it1160 it('should return a new InternalServerError when given "Internal Server Error"', () => {1161 unit1162 .object(HttpError('Internal Server Error'))1163 .isInstanceOf(Error)1164 .isInstanceOf(HttpError)1165 .isInstanceOf(ServerError)1166 .isInstanceOf(InternalServerError)1167 .isEnumerable('code', 500)1168 .isEnumerable('status', 'Internal Server Error')1169 .isEnumerable('message', 'Sorry, it appears we had an unexpected error, please try again.')1170 .isEnumerable('debug')1171 .isEnumerable('cause');1172 }); // end it1173 it('should return a new InternalServerError when given "InternalServerError"', () => {1174 unit1175 .object(HttpError('InternalServerError'))1176 .isInstanceOf(Error)1177 .isInstanceOf(HttpError)1178 .isInstanceOf(ServerError)1179 .isInstanceOf(InternalServerError)1180 .isEnumerable('code', 500)1181 .isEnumerable('status', 'Internal Server Error')1182 .isEnumerable('message', 'Sorry, it appears we had an unexpected error, please try again.')1183 .isEnumerable('debug')1184 .isEnumerable('cause');1185 }); // end it1186 it('should return a new NotImplemented when given 501', () => {1187 unit1188 .object(HttpError(501))1189 .isInstanceOf(Error)1190 .isInstanceOf(HttpError)1191 .isInstanceOf(ServerError)1192 .isInstanceOf(NotImplemented)1193 .isEnumerable('code', 501)1194 .isEnumerable('status', 'Not Implemented')1195 .isEnumerable('message', 'Sorry, this is not fully implemented, please try later.')1196 .isEnumerable('debug')1197 .isEnumerable('cause');1198 }); // end it1199 it('should return a new NotImplemented when given "Not Implemented"', () => {1200 unit1201 .object(HttpError('Not Implemented'))1202 .isInstanceOf(Error)1203 .isInstanceOf(HttpError)1204 .isInstanceOf(ServerError)1205 .isInstanceOf(NotImplemented)1206 .isEnumerable('code', 501)1207 .isEnumerable('status', 'Not Implemented')1208 .isEnumerable('message', 'Sorry, this is not fully implemented, please try later.')1209 .isEnumerable('debug')1210 .isEnumerable('cause');1211 }); // end it1212 it('should return a new NotImplemented when given "NotImplemented"', () => {1213 unit1214 .object(HttpError('NotImplemented'))1215 .isInstanceOf(Error)1216 .isInstanceOf(HttpError)1217 .isInstanceOf(ServerError)1218 .isInstanceOf(NotImplemented)1219 .isEnumerable('code', 501)1220 .isEnumerable('status', 'Not Implemented')1221 .isEnumerable('message', 'Sorry, this is not fully implemented, please try later.')1222 .isEnumerable('debug')1223 .isEnumerable('cause');1224 }); // end it1225 it('should return a new BadGateway when given 502', () => {1226 unit1227 .object(HttpError(502))1228 .isInstanceOf(Error)1229 .isInstanceOf(HttpError)1230 .isInstanceOf(ServerError)1231 .isInstanceOf(BadGateway)1232 .isEnumerable('code', 502)1233 .isEnumerable('status', 'Bad Gateway')1234 .isEnumerable('message', 'Sorry, It appears we received an error from another service that is needed to fulfill your request, please try again later.')1235 .isEnumerable('debug')1236 .isEnumerable('cause');1237 }); // end it1238 it('should return a new BadGateway when given "Bad Gateway"', () => {1239 unit1240 .object(HttpError('Bad Gateway'))1241 .isInstanceOf(Error)1242 .isInstanceOf(HttpError)1243 .isInstanceOf(ServerError)1244 .isInstanceOf(BadGateway)1245 .isEnumerable('code', 502)1246 .isEnumerable('status', 'Bad Gateway')1247 .isEnumerable('message', 'Sorry, It appears we received an error from another service that is needed to fulfill your request, please try again later.')1248 .isEnumerable('debug')1249 .isEnumerable('cause');1250 }); // end it1251 it('should return a new BadGateway when given "BadGateway"', () => {1252 unit1253 .object(HttpError('BadGateway'))1254 .isInstanceOf(Error)1255 .isInstanceOf(HttpError)1256 .isInstanceOf(ServerError)1257 .isInstanceOf(BadGateway)1258 .isEnumerable('code', 502)1259 .isEnumerable('status', 'Bad Gateway')1260 .isEnumerable('message', 'Sorry, It appears we received an error from another service that is needed to fulfill your request, please try again later.')1261 .isEnumerable('debug')1262 .isEnumerable('cause');1263 }); // end it1264 it('should return a new ServiceUnavailable when given 503', () => {1265 unit1266 .object(HttpError(503))1267 .isInstanceOf(Error)1268 .isInstanceOf(HttpError)1269 .isInstanceOf(ServerError)1270 .isInstanceOf(ServiceUnavailable)1271 .isEnumerable('code', 503)1272 .isEnumerable('status', 'Service Unavailable')1273 .isEnumerable('message', 'Sorry, this service is currently unavailable, please try later.')1274 .isEnumerable('debug')1275 .isEnumerable('cause');1276 }); // end it1277 it('should return a new ServiceUnavailable when given "Service Unavailable"', () => {1278 unit1279 .object(HttpError('Service Unavailable'))1280 .isInstanceOf(Error)1281 .isInstanceOf(HttpError)1282 .isInstanceOf(ServerError)1283 .isInstanceOf(ServiceUnavailable)1284 .isEnumerable('code', 503)1285 .isEnumerable('status', 'Service Unavailable')1286 .isEnumerable('message', 'Sorry, this service is currently unavailable, please try later.')1287 .isEnumerable('debug')1288 .isEnumerable('cause');1289 }); // end it1290 it('should return a new ServiceUnavailable when given "ServiceUnavailable"', () => {1291 unit1292 .object(HttpError('ServiceUnavailable'))1293 .isInstanceOf(Error)1294 .isInstanceOf(HttpError)1295 .isInstanceOf(ServerError)1296 .isInstanceOf(ServiceUnavailable)1297 .isEnumerable('code', 503)1298 .isEnumerable('status', 'Service Unavailable')1299 .isEnumerable('message', 'Sorry, this service is currently unavailable, please try later.')1300 .isEnumerable('debug')1301 .isEnumerable('cause');1302 }); // end it1303 it('should return a new GatewayTimeout when given 504', () => {1304 unit1305 .object(HttpError(504))1306 .isInstanceOf(Error)1307 .isInstanceOf(HttpError)1308 .isInstanceOf(ServerError)1309 .isInstanceOf(GatewayTimeout)1310 .isEnumerable('code', 504)1311 .isEnumerable('status', 'Gateway Timeout')1312 .isEnumerable('message', 'Sorry, it appears another service is taking to long and we cannot wait any longer.')1313 .isEnumerable('debug')1314 .isEnumerable('cause');1315 }); // end it1316 it('should return a new GatewayTimeout when given "Gateway Timeout"', () => {1317 unit1318 .object(HttpError('Gateway Timeout'))1319 .isInstanceOf(Error)1320 .isInstanceOf(HttpError)1321 .isInstanceOf(ServerError)1322 .isInstanceOf(GatewayTimeout)1323 .isEnumerable('code', 504)1324 .isEnumerable('status', 'Gateway Timeout')1325 .isEnumerable('message', 'Sorry, it appears another service is taking to long and we cannot wait any longer.')1326 .isEnumerable('debug')1327 .isEnumerable('cause');1328 }); // end it1329 it('should return a new GatewayTimeout when given "GatewayTimeout"', () => {1330 unit1331 .object(HttpError('GatewayTimeout'))1332 .isInstanceOf(Error)1333 .isInstanceOf(HttpError)1334 .isInstanceOf(ServerError)1335 .isInstanceOf(GatewayTimeout)1336 .isEnumerable('code', 504)1337 .isEnumerable('status', 'Gateway Timeout')1338 .isEnumerable('message', 'Sorry, it appears another service is taking to long and we cannot wait any longer.')1339 .isEnumerable('debug')1340 .isEnumerable('cause');1341 }); // end it1342 it('should return a new HTTPVersionNotSupported when given 505', () => {1343 unit1344 .object(HttpError(505))1345 .isInstanceOf(Error)1346 .isInstanceOf(HttpError)1347 .isInstanceOf(ServerError)1348 .isInstanceOf(HTTPVersionNotSupported)1349 .isEnumerable('code', 505)1350 .isEnumerable('status', 'HTTP Version Not Supported')1351 .isEnumerable('message', 'Please, try a diffrent protocol version and try again.')1352 .isEnumerable('debug')1353 .isEnumerable('cause');1354 }); // end it1355 it('should return a new HTTPVersionNotSupported when given "HTTP Version Not Supported"', () => {1356 unit1357 .object(HttpError('HTTP Version Not Supported'))1358 .isInstanceOf(Error)1359 .isInstanceOf(HttpError)1360 .isInstanceOf(ServerError)1361 .isInstanceOf(HTTPVersionNotSupported)1362 .isEnumerable('code', 505)1363 .isEnumerable('status', 'HTTP Version Not Supported')1364 .isEnumerable('message', 'Please, try a diffrent protocol version and try again.')1365 .isEnumerable('debug')1366 .isEnumerable('cause');1367 }); // end it1368 it('should return a new HTTPVersionNotSupported when given "HTTPVersionNotSupported"', () => {1369 unit1370 .object(HttpError('HTTPVersionNotSupported'))1371 .isInstanceOf(Error)1372 .isInstanceOf(HttpError)1373 .isInstanceOf(ServerError)1374 .isInstanceOf(HTTPVersionNotSupported)1375 .isEnumerable('code', 505)1376 .isEnumerable('status', 'HTTP Version Not Supported')1377 .isEnumerable('message', 'Please, try a diffrent protocol version and try again.')1378 .isEnumerable('debug')1379 .isEnumerable('cause');1380 }); // end it1381 it('should return a new VariantAlsoNegotiates when given 506', () => {1382 unit1383 .object(HttpError(506))1384 .isInstanceOf(Error)1385 .isInstanceOf(HttpError)1386 .isInstanceOf(ServerError)1387 .isInstanceOf(VariantAlsoNegotiates)1388 .isEnumerable('code', 506)1389 .isEnumerable('status', 'Variant Also Negotiates')1390 .isEnumerable('message', 'Sorry, it appears there is a misconfiguration on our end.')1391 .isEnumerable('debug')1392 .isEnumerable('cause');1393 }); // end it1394 it('should return a new VariantAlsoNegotiates when given "Variant Also Negotiates"', () => {1395 unit1396 .object(HttpError('Variant Also Negotiates'))1397 .isInstanceOf(Error)1398 .isInstanceOf(HttpError)1399 .isInstanceOf(ServerError)1400 .isInstanceOf(VariantAlsoNegotiates)1401 .isEnumerable('code', 506)1402 .isEnumerable('status', 'Variant Also Negotiates')1403 .isEnumerable('message', 'Sorry, it appears there is a misconfiguration on our end.')1404 .isEnumerable('debug')1405 .isEnumerable('cause');1406 }); // end it1407 it('should return a new VariantAlsoNegotiates when given "VariantAlsoNegotiates"', () => {1408 unit1409 .object(HttpError('VariantAlsoNegotiates'))1410 .isInstanceOf(Error)1411 .isInstanceOf(HttpError)1412 .isInstanceOf(ServerError)1413 .isInstanceOf(VariantAlsoNegotiates)1414 .isEnumerable('code', 506)1415 .isEnumerable('status', 'Variant Also Negotiates')1416 .isEnumerable('message', 'Sorry, it appears there is a misconfiguration on our end.')1417 .isEnumerable('debug')1418 .isEnumerable('cause');1419 }); // end it1420 it('should return a new InsufficientStorage when given 507', () => {1421 unit1422 .object(HttpError(507))1423 .isInstanceOf(Error)1424 .isInstanceOf(HttpError)1425 .isInstanceOf(ServerError)1426 .isInstanceOf(InsufficientStorage)1427 .isEnumerable('code', 507)1428 .isEnumerable('status', 'Insufficient Storage')1429 .isEnumerable('message', 'Sorry, it appears we have no more room for storage.')1430 .isEnumerable('debug')1431 .isEnumerable('cause');1432 }); // end it1433 it('should return a new InsufficientStorage when given "Insufficient Storage"', () => {1434 unit1435 .object(HttpError('Insufficient Storage'))1436 .isInstanceOf(Error)1437 .isInstanceOf(HttpError)1438 .isInstanceOf(ServerError)1439 .isInstanceOf(InsufficientStorage)1440 .isEnumerable('code', 507)1441 .isEnumerable('status', 'Insufficient Storage')1442 .isEnumerable('message', 'Sorry, it appears we have no more room for storage.')1443 .isEnumerable('debug')1444 .isEnumerable('cause');1445 }); // end it1446 it('should return a new InsufficientStorage when given "InsufficientStorage"', () => {1447 unit1448 .object(HttpError('InsufficientStorage'))1449 .isInstanceOf(Error)1450 .isInstanceOf(HttpError)1451 .isInstanceOf(ServerError)1452 .isInstanceOf(InsufficientStorage)1453 .isEnumerable('code', 507)1454 .isEnumerable('status', 'Insufficient Storage')1455 .isEnumerable('message', 'Sorry, it appears we have no more room for storage.')1456 .isEnumerable('debug')1457 .isEnumerable('cause');1458 }); // end it1459 it('should return a new LoopDetected when given 508', () => {1460 unit1461 .object(HttpError(508))1462 .isInstanceOf(Error)1463 .isInstanceOf(HttpError)1464 .isInstanceOf(ServerError)1465 .isInstanceOf(LoopDetected)1466 .isEnumerable('code', 508)1467 .isEnumerable('status', 'Loop Detected')1468 .isEnumerable('message', 'Sorry, We have detected an infintie loop and had to stop the request, please try again later.')1469 .isEnumerable('debug')1470 .isEnumerable('cause');1471 }); // end it1472 it('should return a new LoopDetected when given "Loop Detected"', () => {1473 unit1474 .object(HttpError('Loop Detected'))1475 .isInstanceOf(Error)1476 .isInstanceOf(HttpError)1477 .isInstanceOf(ServerError)1478 .isInstanceOf(LoopDetected)1479 .isEnumerable('code', 508)1480 .isEnumerable('status', 'Loop Detected')1481 .isEnumerable('message', 'Sorry, We have detected an infintie loop and had to stop the request, please try again later.')1482 .isEnumerable('debug')1483 .isEnumerable('cause');1484 }); // end it1485 it('should return a new LoopDetected when given "LoopDetected"', () => {1486 unit1487 .object(HttpError('LoopDetected'))1488 .isInstanceOf(Error)1489 .isInstanceOf(HttpError)1490 .isInstanceOf(ServerError)1491 .isInstanceOf(LoopDetected)1492 .isEnumerable('code', 508)1493 .isEnumerable('status', 'Loop Detected')1494 .isEnumerable('message', 'Sorry, We have detected an infintie loop and had to stop the request, please try again later.')1495 .isEnumerable('debug')1496 .isEnumerable('cause');1497 }); // end it1498 it('should return a new NotExtended when given 510', () => {1499 unit1500 .object(HttpError(510))1501 .isInstanceOf(Error)1502 .isInstanceOf(HttpError)1503 .isInstanceOf(ServerError)1504 .isInstanceOf(NotExtended)1505 .isEnumerable('code', 510)1506 .isEnumerable('status', 'Not Extended')1507 .isEnumerable('message', 'The policy for accessing this resource has not been met by this request.')1508 .isEnumerable('debug')1509 .isEnumerable('cause');1510 }); // end it1511 it('should return a new NotExtended when given "Not Extended"', () => {1512 unit1513 .object(HttpError('Not Extended'))1514 .isInstanceOf(Error)1515 .isInstanceOf(HttpError)1516 .isInstanceOf(ServerError)1517 .isInstanceOf(NotExtended)1518 .isEnumerable('code', 510)1519 .isEnumerable('status', 'Not Extended')1520 .isEnumerable('message', 'The policy for accessing this resource has not been met by this request.')1521 .isEnumerable('debug')1522 .isEnumerable('cause');1523 }); // end it1524 it('should return a new NotExtended when given "NotExtended"', () => {1525 unit1526 .object(HttpError('NotExtended'))1527 .isInstanceOf(Error)1528 .isInstanceOf(HttpError)1529 .isInstanceOf(ServerError)1530 .isInstanceOf(NotExtended)1531 .isEnumerable('code', 510)1532 .isEnumerable('status', 'Not Extended')1533 .isEnumerable('message', 'The policy for accessing this resource has not been met by this request.')1534 .isEnumerable('debug')1535 .isEnumerable('cause');1536 }); // end it1537 it('should return a new NetworkAuthenticationRequired when given 511', () => {1538 unit1539 .object(HttpError(511))1540 .isInstanceOf(Error)1541 .isInstanceOf(HttpError)1542 .isInstanceOf(ServerError)1543 .isInstanceOf(NetworkAuthenticationRequired)1544 .isEnumerable('code', 511)1545 .isEnumerable('status', 'Network Authentication Required')1546 .isEnumerable('message', 'Please, authenticate with the network and try again.')1547 .isEnumerable('debug')1548 .isEnumerable('cause');1549 }); // end it1550 it('should return a new NetworkAuthenticationRequired when given "Network Authentication Required"', () => {1551 unit1552 .object(HttpError('Network Authentication Required'))1553 .isInstanceOf(Error)1554 .isInstanceOf(HttpError)1555 .isInstanceOf(ServerError)1556 .isInstanceOf(NetworkAuthenticationRequired)1557 .isEnumerable('code', 511)1558 .isEnumerable('status', 'Network Authentication Required')1559 .isEnumerable('message', 'Please, authenticate with the network and try again.')1560 .isEnumerable('debug')1561 .isEnumerable('cause');1562 }); // end it1563 it('should return a new NetworkAuthenticationRequired when given "NetworkAuthenticationRequired"', () => {1564 unit1565 .object(HttpError('NetworkAuthenticationRequired'))1566 .isInstanceOf(Error)1567 .isInstanceOf(HttpError)1568 .isInstanceOf(ServerError)1569 .isInstanceOf(NetworkAuthenticationRequired)1570 .isEnumerable('code', 511)1571 .isEnumerable('status', 'Network Authentication Required')1572 .isEnumerable('message', 'Please, authenticate with the network and try again.')1573 .isEnumerable('debug')1574 .isEnumerable('cause');1575 }); // end it1576 it('should return a new UnknownError when given 520', () => {1577 unit1578 .object(HttpError(520))1579 .isInstanceOf(Error)1580 .isInstanceOf(HttpError)1581 .isInstanceOf(ServerError)1582 .isInstanceOf(UnknownError)1583 .isEnumerable('code', 520)1584 .isEnumerable('status', 'Unknown Error')1585 .isEnumerable('message', 'Sorry, an unexpected error has occured, please try again later.')1586 .isEnumerable('debug')1587 .isEnumerable('cause');1588 }); // end it1589 it('should return a new UnknownError when given "Unknown Error"', () => {1590 unit1591 .object(HttpError('Unknown Error'))1592 .isInstanceOf(Error)1593 .isInstanceOf(HttpError)1594 .isInstanceOf(ServerError)1595 .isInstanceOf(UnknownError)1596 .isEnumerable('code', 520)1597 .isEnumerable('status', 'Unknown Error')1598 .isEnumerable('message', 'Sorry, an unexpected error has occured, please try again later.')1599 .isEnumerable('debug')1600 .isEnumerable('cause');1601 }); // end it1602 it('should return a new UnknownError when given "UnknownError"', () => {1603 unit1604 .object(HttpError('UnknownError'))1605 .isInstanceOf(Error)1606 .isInstanceOf(HttpError)1607 .isInstanceOf(ServerError)1608 .isInstanceOf(UnknownError)1609 .isEnumerable('code', 520)1610 .isEnumerable('status', 'Unknown Error')1611 .isEnumerable('message', 'Sorry, an unexpected error has occured, please try again later.')1612 .isEnumerable('debug')1613 .isEnumerable('cause');1614 }); // end it...
ClientError.js
Source:ClientError.js
...39 }); // end it40 it('should return a new BadRequest when given 400', () => {41 unit42 .object(ClientError(400))43 .isInstanceOf(Error)44 .isInstanceOf(ClientError)45 .isInstanceOf(BadRequest)46 .isEnumerable('code', 400)47 .isEnumerable('status', 'Bad Request')48 .isEnumerable('message', 'Please, correct your request and try again.')49 .isEnumerable('debug')50 .isEnumerable('cause');51 }); // end it52 it('should return a new BadRequest when given "Bad Request"', () => {53 unit54 .object(ClientError('Bad Request'))55 .isInstanceOf(Error)56 .isInstanceOf(ClientError)57 .isInstanceOf(BadRequest)58 .isEnumerable('code', 400)59 .isEnumerable('status', 'Bad Request')60 .isEnumerable('message', 'Please, correct your request and try again.')61 .isEnumerable('debug')62 .isEnumerable('cause');63 }); // end it64 it('should return a new BadRequest when given "BadRequest"', () => {65 unit66 .object(ClientError('BadRequest'))67 .isInstanceOf(Error)68 .isInstanceOf(ClientError)69 .isInstanceOf(BadRequest)70 .isEnumerable('code', 400)71 .isEnumerable('status', 'Bad Request')72 .isEnumerable('message', 'Please, correct your request and try again.')73 .isEnumerable('debug')74 .isEnumerable('cause');75 }); // end it76 it('should return a new Unauthorized when given 401', () => {77 unit78 .object(ClientError(401))79 .isInstanceOf(Error)80 .isInstanceOf(ClientError)81 .isInstanceOf(Unauthorized)82 .isEnumerable('code', 401)83 .isEnumerable('status', 'Unauthorized')84 .isEnumerable('message', 'Please, authenticate and try again.')85 .isEnumerable('debug')86 .isEnumerable('cause');87 }); // end it88 it('should return a new Unauthorized when given "Unauthorized"', () => {89 unit90 .object(ClientError('Unauthorized'))91 .isInstanceOf(Error)92 .isInstanceOf(ClientError)93 .isInstanceOf(Unauthorized)94 .isEnumerable('code', 401)95 .isEnumerable('status', 'Unauthorized')96 .isEnumerable('message', 'Please, authenticate and try again.')97 .isEnumerable('debug')98 .isEnumerable('cause');99 }); // end it100 it('should return a new Unauthorized when given "Unauthorized"', () => {101 unit102 .object(ClientError('Unauthorized'))103 .isInstanceOf(Error)104 .isInstanceOf(ClientError)105 .isInstanceOf(Unauthorized)106 .isEnumerable('code', 401)107 .isEnumerable('status', 'Unauthorized')108 .isEnumerable('message', 'Please, authenticate and try again.')109 .isEnumerable('debug')110 .isEnumerable('cause');111 }); // end it112 it('should return a new PaymentRequired when given 402', () => {113 unit114 .object(ClientError(402))115 .isInstanceOf(Error)116 .isInstanceOf(ClientError)117 .isInstanceOf(PaymentRequired)118 .isEnumerable('code', 402)119 .isEnumerable('status', 'Payment Required')120 .isEnumerable('message', 'Payment is required to use this service.')121 .isEnumerable('debug')122 .isEnumerable('cause');123 }); // end it124 it('should return a new PaymentRequired when given "Payment Required"', () => {125 unit126 .object(ClientError('Payment Required'))127 .isInstanceOf(Error)128 .isInstanceOf(ClientError)129 .isInstanceOf(PaymentRequired)130 .isEnumerable('code', 402)131 .isEnumerable('status', 'Payment Required')132 .isEnumerable('message', 'Payment is required to use this service.')133 .isEnumerable('debug')134 .isEnumerable('cause');135 }); // end it136 it('should return a new PaymentRequired when given "PaymentRequired"', () => {137 unit138 .object(ClientError('PaymentRequired'))139 .isInstanceOf(Error)140 .isInstanceOf(ClientError)141 .isInstanceOf(PaymentRequired)142 .isEnumerable('code', 402)143 .isEnumerable('status', 'Payment Required')144 .isEnumerable('message', 'Payment is required to use this service.')145 .isEnumerable('debug')146 .isEnumerable('cause');147 }); // end it148 it('should return a new Forbidden when given 403', () => {149 unit150 .object(ClientError(403))151 .isInstanceOf(Error)152 .isInstanceOf(ClientError)153 .isInstanceOf(Forbidden)154 .isEnumerable('code', 403)155 .isEnumerable('status', 'Forbidden')156 .isEnumerable('message', 'You lack permission to preform this action.')157 .isEnumerable('debug')158 .isEnumerable('cause');159 }); // end it160 it('should return a new Forbidden when given "Forbidden"', () => {161 unit162 .object(ClientError('Forbidden'))163 .isInstanceOf(Error)164 .isInstanceOf(ClientError)165 .isInstanceOf(Forbidden)166 .isEnumerable('code', 403)167 .isEnumerable('status', 'Forbidden')168 .isEnumerable('message', 'You lack permission to preform this action.')169 .isEnumerable('debug')170 .isEnumerable('cause');171 }); // end it172 it('should return a new Forbidden when given "Forbidden"', () => {173 unit174 .object(ClientError('Forbidden'))175 .isInstanceOf(Error)176 .isInstanceOf(ClientError)177 .isInstanceOf(Forbidden)178 .isEnumerable('code', 403)179 .isEnumerable('status', 'Forbidden')180 .isEnumerable('message', 'You lack permission to preform this action.')181 .isEnumerable('debug')182 .isEnumerable('cause');183 }); // end it184 it('should return a new NotFound when given 404', () => {185 unit186 .object(ClientError(404))187 .isInstanceOf(Error)188 .isInstanceOf(ClientError)189 .isInstanceOf(NotFound)190 .isEnumerable('code', 404)191 .isEnumerable('status', 'Not Found')192 .isEnumerable('message', 'The requested document was not found.')193 .isEnumerable('debug')194 .isEnumerable('cause');195 }); // end it196 it('should return a new NotFound when given "Not Found"', () => {197 unit198 .object(ClientError('Not Found'))199 .isInstanceOf(Error)200 .isInstanceOf(ClientError)201 .isInstanceOf(NotFound)202 .isEnumerable('code', 404)203 .isEnumerable('status', 'Not Found')204 .isEnumerable('message', 'The requested document was not found.')205 .isEnumerable('debug')206 .isEnumerable('cause');207 }); // end it208 it('should return a new NotFound when given "NotFound"', () => {209 unit210 .object(ClientError('NotFound'))211 .isInstanceOf(Error)212 .isInstanceOf(ClientError)213 .isInstanceOf(NotFound)214 .isEnumerable('code', 404)215 .isEnumerable('status', 'Not Found')216 .isEnumerable('message', 'The requested document was not found.')217 .isEnumerable('debug')218 .isEnumerable('cause');219 }); // end it220 it('should return a new MethodNotAllowed when given 405', () => {221 unit222 .object(ClientError(405))223 .isInstanceOf(Error)224 .isInstanceOf(ClientError)225 .isInstanceOf(MethodNotAllowed)226 .isEnumerable('code', 405)227 .isEnumerable('status', 'Method Not Allowed')228 .isEnumerable('message', 'Please, check your request method and try again.')229 .isEnumerable('debug')230 .isEnumerable('cause');231 }); // end it232 it('should return a new MethodNotAllowed when given "Method Not Allowed"', () => {233 unit234 .object(ClientError('Method Not Allowed'))235 .isInstanceOf(Error)236 .isInstanceOf(ClientError)237 .isInstanceOf(MethodNotAllowed)238 .isEnumerable('code', 405)239 .isEnumerable('status', 'Method Not Allowed')240 .isEnumerable('message', 'Please, check your request method and try again.')241 .isEnumerable('debug')242 .isEnumerable('cause');243 }); // end it244 it('should return a new MethodNotAllowed when given "MethodNotAllowed"', () => {245 unit246 .object(ClientError('MethodNotAllowed'))247 .isInstanceOf(Error)248 .isInstanceOf(ClientError)249 .isInstanceOf(MethodNotAllowed)250 .isEnumerable('code', 405)251 .isEnumerable('status', 'Method Not Allowed')252 .isEnumerable('message', 'Please, check your request method and try again.')253 .isEnumerable('debug')254 .isEnumerable('cause');255 }); // end it256 it('should return a new NotAcceptable when given 406', () => {257 unit258 .object(ClientError(406))259 .isInstanceOf(Error)260 .isInstanceOf(ClientError)261 .isInstanceOf(NotAcceptable)262 .isEnumerable('code', 406)263 .isEnumerable('status', 'Not Acceptable')264 .isEnumerable('message', 'The requested document format is not supported.')265 .isEnumerable('debug')266 .isEnumerable('cause');267 }); // end it268 it('should return a new NotAcceptable when given "Not Acceptable"', () => {269 unit270 .object(ClientError('Not Acceptable'))271 .isInstanceOf(Error)272 .isInstanceOf(ClientError)273 .isInstanceOf(NotAcceptable)274 .isEnumerable('code', 406)275 .isEnumerable('status', 'Not Acceptable')276 .isEnumerable('message', 'The requested document format is not supported.')277 .isEnumerable('debug')278 .isEnumerable('cause');279 }); // end it280 it('should return a new NotAcceptable when given "NotAcceptable"', () => {281 unit282 .object(ClientError('NotAcceptable'))283 .isInstanceOf(Error)284 .isInstanceOf(ClientError)285 .isInstanceOf(NotAcceptable)286 .isEnumerable('code', 406)287 .isEnumerable('status', 'Not Acceptable')288 .isEnumerable('message', 'The requested document format is not supported.')289 .isEnumerable('debug')290 .isEnumerable('cause');291 }); // end it292 it('should return a new ProxyAuthenticationRequired when given 407', () => {293 unit294 .object(ClientError(407))295 .isInstanceOf(Error)296 .isInstanceOf(ClientError)297 .isInstanceOf(ProxyAuthenticationRequired)298 .isEnumerable('code', 407)299 .isEnumerable('status', 'Proxy Authentication Required')300 .isEnumerable('message', 'Please, authenticate with the proxy server and try again.')301 .isEnumerable('debug')302 .isEnumerable('cause');303 }); // end it304 it('should return a new ProxyAuthenticationRequired when given "Proxy Authentication Required"', () => {305 unit306 .object(ClientError('Proxy Authentication Required'))307 .isInstanceOf(Error)308 .isInstanceOf(ClientError)309 .isInstanceOf(ProxyAuthenticationRequired)310 .isEnumerable('code', 407)311 .isEnumerable('status', 'Proxy Authentication Required')312 .isEnumerable('message', 'Please, authenticate with the proxy server and try again.')313 .isEnumerable('debug')314 .isEnumerable('cause');315 }); // end it316 it('should return a new ProxyAuthenticationRequired when given "ProxyAuthenticationRequired"', () => {317 unit318 .object(ClientError('ProxyAuthenticationRequired'))319 .isInstanceOf(Error)320 .isInstanceOf(ClientError)321 .isInstanceOf(ProxyAuthenticationRequired)322 .isEnumerable('code', 407)323 .isEnumerable('status', 'Proxy Authentication Required')324 .isEnumerable('message', 'Please, authenticate with the proxy server and try again.')325 .isEnumerable('debug')326 .isEnumerable('cause');327 }); // end it328 it('should return a new RequestTimeout when given 408', () => {329 unit330 .object(ClientError(408))331 .isInstanceOf(Error)332 .isInstanceOf(ClientError)333 .isInstanceOf(RequestTimeout)334 .isEnumerable('code', 408)335 .isEnumerable('status', 'Request Timeout')336 .isEnumerable('message', 'Sorry, it appears we are on break, please try again later.')337 .isEnumerable('debug')338 .isEnumerable('cause');339 }); // end it340 it('should return a new RequestTimeout when given "Request Timeout"', () => {341 unit342 .object(ClientError('Request Timeout'))343 .isInstanceOf(Error)344 .isInstanceOf(ClientError)345 .isInstanceOf(RequestTimeout)346 .isEnumerable('code', 408)347 .isEnumerable('status', 'Request Timeout')348 .isEnumerable('message', 'Sorry, it appears we are on break, please try again later.')349 .isEnumerable('debug')350 .isEnumerable('cause');351 }); // end it352 it('should return a new RequestTimeout when given "RequestTimeout"', () => {353 unit354 .object(ClientError('RequestTimeout'))355 .isInstanceOf(Error)356 .isInstanceOf(ClientError)357 .isInstanceOf(RequestTimeout)358 .isEnumerable('code', 408)359 .isEnumerable('status', 'Request Timeout')360 .isEnumerable('message', 'Sorry, it appears we are on break, please try again later.')361 .isEnumerable('debug')362 .isEnumerable('cause');363 }); // end it364 it('should return a new Conflict when given 409', () => {365 unit366 .object(ClientError(409))367 .isInstanceOf(Error)368 .isInstanceOf(ClientError)369 .isInstanceOf(Conflict)370 .isEnumerable('code', 409)371 .isEnumerable('status', 'Conflict')372 .isEnumerable('message', 'Houston, we have a conflict, please reload the resource and try again.')373 .isEnumerable('debug')374 .isEnumerable('cause');375 }); // end it376 it('should return a new Conflict when given "Conflict"', () => {377 unit378 .object(ClientError('Conflict'))379 .isInstanceOf(Error)380 .isInstanceOf(ClientError)381 .isInstanceOf(Conflict)382 .isEnumerable('code', 409)383 .isEnumerable('status', 'Conflict')384 .isEnumerable('message', 'Houston, we have a conflict, please reload the resource and try again.')385 .isEnumerable('debug')386 .isEnumerable('cause');387 }); // end it388 it('should return a new Conflict when given "Conflict"', () => {389 unit390 .object(ClientError('Conflict'))391 .isInstanceOf(Error)392 .isInstanceOf(ClientError)393 .isInstanceOf(Conflict)394 .isEnumerable('code', 409)395 .isEnumerable('status', 'Conflict')396 .isEnumerable('message', 'Houston, we have a conflict, please reload the resource and try again.')397 .isEnumerable('debug')398 .isEnumerable('cause');399 }); // end it400 it('should return a new Gone when given 410', () => {401 unit402 .object(ClientError(410))403 .isInstanceOf(Error)404 .isInstanceOf(ClientError)405 .isInstanceOf(Gone)406 .isEnumerable('code', 410)407 .isEnumerable('status', 'Gone')408 .isEnumerable('message', 'Sorry, but that resource has been removed.')409 .isEnumerable('debug')410 .isEnumerable('cause');411 }); // end it412 it('should return a new Gone when given "Gone"', () => {413 unit414 .object(ClientError('Gone'))415 .isInstanceOf(Error)416 .isInstanceOf(ClientError)417 .isInstanceOf(Gone)418 .isEnumerable('code', 410)419 .isEnumerable('status', 'Gone')420 .isEnumerable('message', 'Sorry, but that resource has been removed.')421 .isEnumerable('debug')422 .isEnumerable('cause');423 }); // end it424 it('should return a new Gone when given "Gone"', () => {425 unit426 .object(ClientError('Gone'))427 .isInstanceOf(Error)428 .isInstanceOf(ClientError)429 .isInstanceOf(Gone)430 .isEnumerable('code', 410)431 .isEnumerable('status', 'Gone')432 .isEnumerable('message', 'Sorry, but that resource has been removed.')433 .isEnumerable('debug')434 .isEnumerable('cause');435 }); // end it436 it('should return a new LengthRequired when given 411', () => {437 unit438 .object(ClientError(411))439 .isInstanceOf(Error)440 .isInstanceOf(ClientError)441 .isInstanceOf(LengthRequired)442 .isEnumerable('code', 411)443 .isEnumerable('status', 'Length Required')444 .isEnumerable('message', 'Please, correct the Length header and try again.')445 .isEnumerable('debug')446 .isEnumerable('cause');447 }); // end it448 it('should return a new LengthRequired when given "Length Required"', () => {449 unit450 .object(ClientError('Length Required'))451 .isInstanceOf(Error)452 .isInstanceOf(ClientError)453 .isInstanceOf(LengthRequired)454 .isEnumerable('code', 411)455 .isEnumerable('status', 'Length Required')456 .isEnumerable('message', 'Please, correct the Length header and try again.')457 .isEnumerable('debug')458 .isEnumerable('cause');459 }); // end it460 it('should return a new LengthRequired when given "LengthRequired"', () => {461 unit462 .object(ClientError('LengthRequired'))463 .isInstanceOf(Error)464 .isInstanceOf(ClientError)465 .isInstanceOf(LengthRequired)466 .isEnumerable('code', 411)467 .isEnumerable('status', 'Length Required')468 .isEnumerable('message', 'Please, correct the Length header and try again.')469 .isEnumerable('debug')470 .isEnumerable('cause');471 }); // end it472 it('should return a new PreconditionFailed when given 412', () => {473 unit474 .object(ClientError(412))475 .isInstanceOf(Error)476 .isInstanceOf(ClientError)477 .isInstanceOf(PreconditionFailed)478 .isEnumerable('code', 412)479 .isEnumerable('status', 'Precondition Failed')480 .isEnumerable('message', 'Sorry, it appears 1 or more preconditions on the request have changed, please correct and try again.')481 .isEnumerable('debug')482 .isEnumerable('cause');483 }); // end it484 it('should return a new PreconditionFailed when given "Precondition Failed"', () => {485 unit486 .object(ClientError('Precondition Failed'))487 .isInstanceOf(Error)488 .isInstanceOf(ClientError)489 .isInstanceOf(PreconditionFailed)490 .isEnumerable('code', 412)491 .isEnumerable('status', 'Precondition Failed')492 .isEnumerable('message', 'Sorry, it appears 1 or more preconditions on the request have changed, please correct and try again.')493 .isEnumerable('debug')494 .isEnumerable('cause');495 }); // end it496 it('should return a new PreconditionFailed when given "PreconditionFailed"', () => {497 unit498 .object(ClientError('PreconditionFailed'))499 .isInstanceOf(Error)500 .isInstanceOf(ClientError)501 .isInstanceOf(PreconditionFailed)502 .isEnumerable('code', 412)503 .isEnumerable('status', 'Precondition Failed')504 .isEnumerable('message', 'Sorry, it appears 1 or more preconditions on the request have changed, please correct and try again.')505 .isEnumerable('debug')506 .isEnumerable('cause');507 }); // end it508 it('should return a new PayloadTooLarge when given 413', () => {509 unit510 .object(ClientError(413))511 .isInstanceOf(Error)512 .isInstanceOf(ClientError)513 .isInstanceOf(PayloadTooLarge)514 .isEnumerable('code', 413)515 .isEnumerable('status', 'Payload Too Large')516 .isEnumerable('message', 'Request payload is too large and can not be processed.')517 .isEnumerable('debug')518 .isEnumerable('cause');519 }); // end it520 it('should return a new PayloadTooLarge when given "Payload Too Large"', () => {521 unit522 .object(ClientError('Payload Too Large'))523 .isInstanceOf(Error)524 .isInstanceOf(ClientError)525 .isInstanceOf(PayloadTooLarge)526 .isEnumerable('code', 413)527 .isEnumerable('status', 'Payload Too Large')528 .isEnumerable('message', 'Request payload is too large and can not be processed.')529 .isEnumerable('debug')530 .isEnumerable('cause');531 }); // end it532 it('should return a new PayloadTooLarge when given "PayloadTooLarge"', () => {533 unit534 .object(ClientError('PayloadTooLarge'))535 .isInstanceOf(Error)536 .isInstanceOf(ClientError)537 .isInstanceOf(PayloadTooLarge)538 .isEnumerable('code', 413)539 .isEnumerable('status', 'Payload Too Large')540 .isEnumerable('message', 'Request payload is too large and can not be processed.')541 .isEnumerable('debug')542 .isEnumerable('cause');543 }); // end it544 it('should return a new URITooLong when given 414', () => {545 unit546 .object(ClientError(414))547 .isInstanceOf(Error)548 .isInstanceOf(ClientError)549 .isInstanceOf(URITooLong)550 .isEnumerable('code', 414)551 .isEnumerable('status', 'URI Too Long')552 .isEnumerable('message', 'Request uri is too large and can not be processed.')553 .isEnumerable('debug')554 .isEnumerable('cause');555 }); // end it556 it('should return a new URITooLong when given "URI Too Long"', () => {557 unit558 .object(ClientError('URI Too Long'))559 .isInstanceOf(Error)560 .isInstanceOf(ClientError)561 .isInstanceOf(URITooLong)562 .isEnumerable('code', 414)563 .isEnumerable('status', 'URI Too Long')564 .isEnumerable('message', 'Request uri is too large and can not be processed.')565 .isEnumerable('debug')566 .isEnumerable('cause');567 }); // end it568 it('should return a new URITooLong when given "URITooLong"', () => {569 unit570 .object(ClientError('URITooLong'))571 .isInstanceOf(Error)572 .isInstanceOf(ClientError)573 .isInstanceOf(URITooLong)574 .isEnumerable('code', 414)575 .isEnumerable('status', 'URI Too Long')576 .isEnumerable('message', 'Request uri is too large and can not be processed.')577 .isEnumerable('debug')578 .isEnumerable('cause');579 }); // end it580 it('should return a new UnsupportedMediaType when given 415', () => {581 unit582 .object(ClientError(415))583 .isInstanceOf(Error)584 .isInstanceOf(ClientError)585 .isInstanceOf(UnsupportedMediaType)586 .isEnumerable('code', 415)587 .isEnumerable('status', 'Unsupported Media Type')588 .isEnumerable('message', 'Please, try again with a different media format.')589 .isEnumerable('debug')590 .isEnumerable('cause');591 }); // end it592 it('should return a new UnsupportedMediaType when given "Unsupported Media Type"', () => {593 unit594 .object(ClientError('Unsupported Media Type'))595 .isInstanceOf(Error)596 .isInstanceOf(ClientError)597 .isInstanceOf(UnsupportedMediaType)598 .isEnumerable('code', 415)599 .isEnumerable('status', 'Unsupported Media Type')600 .isEnumerable('message', 'Please, try again with a different media format.')601 .isEnumerable('debug')602 .isEnumerable('cause');603 }); // end it604 it('should return a new UnsupportedMediaType when given "UnsupportedMediaType"', () => {605 unit606 .object(ClientError('UnsupportedMediaType'))607 .isInstanceOf(Error)608 .isInstanceOf(ClientError)609 .isInstanceOf(UnsupportedMediaType)610 .isEnumerable('code', 415)611 .isEnumerable('status', 'Unsupported Media Type')612 .isEnumerable('message', 'Please, try again with a different media format.')613 .isEnumerable('debug')614 .isEnumerable('cause');615 }); // end it616 it('should return a new RangeNotSatisfiable when given 416', () => {617 unit618 .object(ClientError(416))619 .isInstanceOf(Error)620 .isInstanceOf(ClientError)621 .isInstanceOf(RangeNotSatisfiable)622 .isEnumerable('code', 416)623 .isEnumerable('status', 'Range Not Satisfiable')624 .isEnumerable('message', 'Requested range is not satisfiable, please check Range and try again.')625 .isEnumerable('debug')626 .isEnumerable('cause');627 }); // end it628 it('should return a new RangeNotSatisfiable when given "Range Not Satisfiable"', () => {629 unit630 .object(ClientError('Range Not Satisfiable'))631 .isInstanceOf(Error)632 .isInstanceOf(ClientError)633 .isInstanceOf(RangeNotSatisfiable)634 .isEnumerable('code', 416)635 .isEnumerable('status', 'Range Not Satisfiable')636 .isEnumerable('message', 'Requested range is not satisfiable, please check Range and try again.')637 .isEnumerable('debug')638 .isEnumerable('cause');639 }); // end it640 it('should return a new RangeNotSatisfiable when given "RangeNotSatisfiable"', () => {641 unit642 .object(ClientError('RangeNotSatisfiable'))643 .isInstanceOf(Error)644 .isInstanceOf(ClientError)645 .isInstanceOf(RangeNotSatisfiable)646 .isEnumerable('code', 416)647 .isEnumerable('status', 'Range Not Satisfiable')648 .isEnumerable('message', 'Requested range is not satisfiable, please check Range and try again.')649 .isEnumerable('debug')650 .isEnumerable('cause');651 }); // end it652 it('should return a new ExpectationFailed when given 417', () => {653 unit654 .object(ClientError(417))655 .isInstanceOf(Error)656 .isInstanceOf(ClientError)657 .isInstanceOf(ExpectationFailed)658 .isEnumerable('code', 417)659 .isEnumerable('status', 'Expectation Failed')660 .isEnumerable('message', 'Sorry, your expectation can not be meet, please check Expect and try again.')661 .isEnumerable('debug')662 .isEnumerable('cause');663 }); // end it664 it('should return a new ExpectationFailed when given "Expectation Failed"', () => {665 unit666 .object(ClientError('Expectation Failed'))667 .isInstanceOf(Error)668 .isInstanceOf(ClientError)669 .isInstanceOf(ExpectationFailed)670 .isEnumerable('code', 417)671 .isEnumerable('status', 'Expectation Failed')672 .isEnumerable('message', 'Sorry, your expectation can not be meet, please check Expect and try again.')673 .isEnumerable('debug')674 .isEnumerable('cause');675 }); // end it676 it('should return a new ExpectationFailed when given "ExpectationFailed"', () => {677 unit678 .object(ClientError('ExpectationFailed'))679 .isInstanceOf(Error)680 .isInstanceOf(ClientError)681 .isInstanceOf(ExpectationFailed)682 .isEnumerable('code', 417)683 .isEnumerable('status', 'Expectation Failed')684 .isEnumerable('message', 'Sorry, your expectation can not be meet, please check Expect and try again.')685 .isEnumerable('debug')686 .isEnumerable('cause');687 }); // end it688 it('should return a new IMATeapot when given 418', () => {689 unit690 .object(ClientError(418))691 .isInstanceOf(Error)692 .isInstanceOf(ClientError)693 .isInstanceOf(IMATeapot)694 .isEnumerable('code', 418)695 .isEnumerable('status', 'I\'m a teapot')696 .isEnumerable('message', 'Tip me over, and pour me out.')697 .isEnumerable('debug')698 .isEnumerable('cause');699 }); // end it700 it('should return a new IMATeapot when given "I\'m a teapot"', () => {701 unit702 .object(ClientError('I\'m a teapot'))703 .isInstanceOf(Error)704 .isInstanceOf(ClientError)705 .isInstanceOf(IMATeapot)706 .isEnumerable('code', 418)707 .isEnumerable('status', 'I\'m a teapot')708 .isEnumerable('message', 'Tip me over, and pour me out.')709 .isEnumerable('debug')710 .isEnumerable('cause');711 }); // end it712 it('should return a new IMATeapot when given "IMATeapot"', () => {713 unit714 .object(ClientError('IMATeapot'))715 .isInstanceOf(Error)716 .isInstanceOf(ClientError)717 .isInstanceOf(IMATeapot)718 .isEnumerable('code', 418)719 .isEnumerable('status', 'I\'m a teapot')720 .isEnumerable('message', 'Tip me over, and pour me out.')721 .isEnumerable('debug')722 .isEnumerable('cause');723 }); // end it724 it('should return a new MisdirectedRequest when given 421', () => {725 unit726 .object(ClientError(421))727 .isInstanceOf(Error)728 .isInstanceOf(ClientError)729 .isInstanceOf(MisdirectedRequest)730 .isEnumerable('code', 421)731 .isEnumerable('status', 'Misdirected Request')732 .isEnumerable('message', 'Sorry, we got misdirected, please try again later.')733 .isEnumerable('debug')734 .isEnumerable('cause');735 }); // end it736 it('should return a new MisdirectedRequest when given "Misdirected Request"', () => {737 unit738 .object(ClientError('Misdirected Request'))739 .isInstanceOf(Error)740 .isInstanceOf(ClientError)741 .isInstanceOf(MisdirectedRequest)742 .isEnumerable('code', 421)743 .isEnumerable('status', 'Misdirected Request')744 .isEnumerable('message', 'Sorry, we got misdirected, please try again later.')745 .isEnumerable('debug')746 .isEnumerable('cause');747 }); // end it748 it('should return a new MisdirectedRequest when given "MisdirectedRequest"', () => {749 unit750 .object(ClientError('MisdirectedRequest'))751 .isInstanceOf(Error)752 .isInstanceOf(ClientError)753 .isInstanceOf(MisdirectedRequest)754 .isEnumerable('code', 421)755 .isEnumerable('status', 'Misdirected Request')756 .isEnumerable('message', 'Sorry, we got misdirected, please try again later.')757 .isEnumerable('debug')758 .isEnumerable('cause');759 }); // end it760 it('should return a new UnprocessableEntity when given 422', () => {761 unit762 .object(ClientError(422))763 .isInstanceOf(Error)764 .isInstanceOf(ClientError)765 .isInstanceOf(UnprocessableEntity)766 .isEnumerable('code', 422)767 .isEnumerable('status', 'Unprocessable Entity')768 .isEnumerable('message', 'Sorry, it appears your document instructions are semantically erroneous.')769 .isEnumerable('debug')770 .isEnumerable('cause');771 }); // end it772 it('should return a new UnprocessableEntity when given "Unprocessable Entity"', () => {773 unit774 .object(ClientError('Unprocessable Entity'))775 .isInstanceOf(Error)776 .isInstanceOf(ClientError)777 .isInstanceOf(UnprocessableEntity)778 .isEnumerable('code', 422)779 .isEnumerable('status', 'Unprocessable Entity')780 .isEnumerable('message', 'Sorry, it appears your document instructions are semantically erroneous.')781 .isEnumerable('debug')782 .isEnumerable('cause');783 }); // end it784 it('should return a new UnprocessableEntity when given "UnprocessableEntity"', () => {785 unit786 .object(ClientError('UnprocessableEntity'))787 .isInstanceOf(Error)788 .isInstanceOf(ClientError)789 .isInstanceOf(UnprocessableEntity)790 .isEnumerable('code', 422)791 .isEnumerable('status', 'Unprocessable Entity')792 .isEnumerable('message', 'Sorry, it appears your document instructions are semantically erroneous.')793 .isEnumerable('debug')794 .isEnumerable('cause');795 }); // end it796 it('should return a new Locked when given 423', () => {797 unit798 .object(ClientError(423))799 .isInstanceOf(Error)800 .isInstanceOf(ClientError)801 .isInstanceOf(Locked)802 .isEnumerable('code', 423)803 .isEnumerable('status', 'Locked')804 .isEnumerable('message', 'Document is currently locked, please try again later.')805 .isEnumerable('debug')806 .isEnumerable('cause');807 }); // end it808 it('should return a new Locked when given "Locked"', () => {809 unit810 .object(ClientError('Locked'))811 .isInstanceOf(Error)812 .isInstanceOf(ClientError)813 .isInstanceOf(Locked)814 .isEnumerable('code', 423)815 .isEnumerable('status', 'Locked')816 .isEnumerable('message', 'Document is currently locked, please try again later.')817 .isEnumerable('debug')818 .isEnumerable('cause');819 }); // end it820 it('should return a new Locked when given "Locked"', () => {821 unit822 .object(ClientError('Locked'))823 .isInstanceOf(Error)824 .isInstanceOf(ClientError)825 .isInstanceOf(Locked)826 .isEnumerable('code', 423)827 .isEnumerable('status', 'Locked')828 .isEnumerable('message', 'Document is currently locked, please try again later.')829 .isEnumerable('debug')830 .isEnumerable('cause');831 }); // end it832 it('should return a new FailedDependency when given 424', () => {833 unit834 .object(ClientError(424))835 .isInstanceOf(Error)836 .isInstanceOf(ClientError)837 .isInstanceOf(FailedDependency)838 .isEnumerable('code', 424)839 .isEnumerable('status', 'Failed Dependency')840 .isEnumerable('message', 'Sorry, it appears a dependent request has failed please retry previous dependent request and try again.')841 .isEnumerable('debug')842 .isEnumerable('cause');843 }); // end it844 it('should return a new FailedDependency when given "Failed Dependency"', () => {845 unit846 .object(ClientError('Failed Dependency'))847 .isInstanceOf(Error)848 .isInstanceOf(ClientError)849 .isInstanceOf(FailedDependency)850 .isEnumerable('code', 424)851 .isEnumerable('status', 'Failed Dependency')852 .isEnumerable('message', 'Sorry, it appears a dependent request has failed please retry previous dependent request and try again.')853 .isEnumerable('debug')854 .isEnumerable('cause');855 }); // end it856 it('should return a new FailedDependency when given "FailedDependency"', () => {857 unit858 .object(ClientError('FailedDependency'))859 .isInstanceOf(Error)860 .isInstanceOf(ClientError)861 .isInstanceOf(FailedDependency)862 .isEnumerable('code', 424)863 .isEnumerable('status', 'Failed Dependency')864 .isEnumerable('message', 'Sorry, it appears a dependent request has failed please retry previous dependent request and try again.')865 .isEnumerable('debug')866 .isEnumerable('cause');867 }); // end it868 it('should return a new UpgradeRequired when given 426', () => {869 unit870 .object(ClientError(426))871 .isInstanceOf(Error)872 .isInstanceOf(ClientError)873 .isInstanceOf(UpgradeRequired)874 .isEnumerable('code', 426)875 .isEnumerable('status', 'Upgrade Required')876 .isEnumerable('message', 'Please, upgrade and try again.')877 .isEnumerable('debug')878 .isEnumerable('cause');879 }); // end it880 it('should return a new UpgradeRequired when given "Upgrade Required"', () => {881 unit882 .object(ClientError('Upgrade Required'))883 .isInstanceOf(Error)884 .isInstanceOf(ClientError)885 .isInstanceOf(UpgradeRequired)886 .isEnumerable('code', 426)887 .isEnumerable('status', 'Upgrade Required')888 .isEnumerable('message', 'Please, upgrade and try again.')889 .isEnumerable('debug')890 .isEnumerable('cause');891 }); // end it892 it('should return a new UpgradeRequired when given "UpgradeRequired"', () => {893 unit894 .object(ClientError('UpgradeRequired'))895 .isInstanceOf(Error)896 .isInstanceOf(ClientError)897 .isInstanceOf(UpgradeRequired)898 .isEnumerable('code', 426)899 .isEnumerable('status', 'Upgrade Required')900 .isEnumerable('message', 'Please, upgrade and try again.')901 .isEnumerable('debug')902 .isEnumerable('cause');903 }); // end it904 it('should return a new PreconditionRequired when given 428', () => {905 unit906 .object(ClientError(428))907 .isInstanceOf(Error)908 .isInstanceOf(ClientError)909 .isInstanceOf(PreconditionRequired)910 .isEnumerable('code', 428)911 .isEnumerable('status', 'Precondition Required')912 .isEnumerable('message', 'Please, add preconditions to your request and try again.')913 .isEnumerable('debug')914 .isEnumerable('cause');915 }); // end it916 it('should return a new PreconditionRequired when given "Precondition Required"', () => {917 unit918 .object(ClientError('Precondition Required'))919 .isInstanceOf(Error)920 .isInstanceOf(ClientError)921 .isInstanceOf(PreconditionRequired)922 .isEnumerable('code', 428)923 .isEnumerable('status', 'Precondition Required')924 .isEnumerable('message', 'Please, add preconditions to your request and try again.')925 .isEnumerable('debug')926 .isEnumerable('cause');927 }); // end it928 it('should return a new PreconditionRequired when given "PreconditionRequired"', () => {929 unit930 .object(ClientError('PreconditionRequired'))931 .isInstanceOf(Error)932 .isInstanceOf(ClientError)933 .isInstanceOf(PreconditionRequired)934 .isEnumerable('code', 428)935 .isEnumerable('status', 'Precondition Required')936 .isEnumerable('message', 'Please, add preconditions to your request and try again.')937 .isEnumerable('debug')938 .isEnumerable('cause');939 }); // end it940 it('should return a new TooManyRequests when given 429', () => {941 unit942 .object(ClientError(429))943 .isInstanceOf(Error)944 .isInstanceOf(ClientError)945 .isInstanceOf(TooManyRequests)946 .isEnumerable('code', 429)947 .isEnumerable('status', 'Too Many Requests')948 .isEnumerable('message', 'Sorry, you have exceeded your rate limit, please try again later.')949 .isEnumerable('debug')950 .isEnumerable('cause');951 }); // end it952 it('should return a new TooManyRequests when given "Too Many Requests"', () => {953 unit954 .object(ClientError('Too Many Requests'))955 .isInstanceOf(Error)956 .isInstanceOf(ClientError)957 .isInstanceOf(TooManyRequests)958 .isEnumerable('code', 429)959 .isEnumerable('status', 'Too Many Requests')960 .isEnumerable('message', 'Sorry, you have exceeded your rate limit, please try again later.')961 .isEnumerable('debug')962 .isEnumerable('cause');963 }); // end it964 it('should return a new TooManyRequests when given "TooManyRequests"', () => {965 unit966 .object(ClientError('TooManyRequests'))967 .isInstanceOf(Error)968 .isInstanceOf(ClientError)969 .isInstanceOf(TooManyRequests)970 .isEnumerable('code', 429)971 .isEnumerable('status', 'Too Many Requests')972 .isEnumerable('message', 'Sorry, you have exceeded your rate limit, please try again later.')973 .isEnumerable('debug')974 .isEnumerable('cause');975 }); // end it976 it('should return a new RequestHeaderFieldsTooLarge when given 431', () => {977 unit978 .object(ClientError(431))979 .isInstanceOf(Error)980 .isInstanceOf(ClientError)981 .isInstanceOf(RequestHeaderFieldsTooLarge)982 .isEnumerable('code', 431)983 .isEnumerable('status', 'Request Header Fields Too Large')984 .isEnumerable('message', 'Request header is too large and can not be processed.')985 .isEnumerable('debug')986 .isEnumerable('cause');987 }); // end it988 it('should return a new RequestHeaderFieldsTooLarge when given "Request Header Fields Too Large"', () => {989 unit990 .object(ClientError('Request Header Fields Too Large'))991 .isInstanceOf(Error)992 .isInstanceOf(ClientError)993 .isInstanceOf(RequestHeaderFieldsTooLarge)994 .isEnumerable('code', 431)995 .isEnumerable('status', 'Request Header Fields Too Large')996 .isEnumerable('message', 'Request header is too large and can not be processed.')997 .isEnumerable('debug')998 .isEnumerable('cause');999 }); // end it1000 it('should return a new RequestHeaderFieldsTooLarge when given "RequestHeaderFieldsTooLarge"', () => {1001 unit1002 .object(ClientError('RequestHeaderFieldsTooLarge'))1003 .isInstanceOf(Error)1004 .isInstanceOf(ClientError)1005 .isInstanceOf(RequestHeaderFieldsTooLarge)1006 .isEnumerable('code', 431)1007 .isEnumerable('status', 'Request Header Fields Too Large')1008 .isEnumerable('message', 'Request header is too large and can not be processed.')1009 .isEnumerable('debug')1010 .isEnumerable('cause');1011 }); // end it1012 it('should return a new UnavailableForLegalReasons when given 451', () => {1013 unit1014 .object(ClientError(451))1015 .isInstanceOf(Error)1016 .isInstanceOf(ClientError)1017 .isInstanceOf(UnavailableForLegalReasons)1018 .isEnumerable('code', 451)1019 .isEnumerable('status', 'Unavailable For Legal Reasons')1020 .isEnumerable('message', 'Due to legal reasons this resource has been removed.')1021 .isEnumerable('debug')1022 .isEnumerable('cause');1023 }); // end it1024 it('should return a new UnavailableForLegalReasons when given "Unavailable For Legal Reasons"', () => {1025 unit1026 .object(ClientError('Unavailable For Legal Reasons'))1027 .isInstanceOf(Error)1028 .isInstanceOf(ClientError)1029 .isInstanceOf(UnavailableForLegalReasons)1030 .isEnumerable('code', 451)1031 .isEnumerable('status', 'Unavailable For Legal Reasons')1032 .isEnumerable('message', 'Due to legal reasons this resource has been removed.')1033 .isEnumerable('debug')1034 .isEnumerable('cause');1035 }); // end it1036 it('should return a new UnavailableForLegalReasons when given "UnavailableForLegalReasons"', () => {1037 unit1038 .object(ClientError('UnavailableForLegalReasons'))1039 .isInstanceOf(Error)1040 .isInstanceOf(ClientError)1041 .isInstanceOf(UnavailableForLegalReasons)1042 .isEnumerable('code', 451)1043 .isEnumerable('status', 'Unavailable For Legal Reasons')1044 .isEnumerable('message', 'Due to legal reasons this resource has been removed.')1045 .isEnumerable('debug')1046 .isEnumerable('cause');1047 }); // end it...
componentInstanceOfTest.js
Source:componentInstanceOfTest.js
...18 */19 testHasSingleInterface: {20 test: function(component){21 var cmp = component.find("basic");22 aura.test.assertTrue(cmp.isInstanceOf("auratest:testInterface"), "missing intf");23 aura.test.assertFalse(cmp.isInstanceOf("auratest:testInterfaceChild"), "extra intf");24 }25 },26 /**27 */28 testHasSingleExtendedInterface: {29 test: function(component){30 var cmp = component.find("child");31 aura.test.assertTrue(cmp.isInstanceOf("auratest:testInterfaceChild"), "missing intf");32 aura.test.assertTrue(cmp.isInstanceOf("auratest:testInterface"), "missing parent intf");33 aura.test.assertFalse(cmp.isInstanceOf("auratest:testInterfaceGrandchild"), "extra intf");34 }35 },36 /**37 */38 testHasSingleExtraExtendedInterface: {39 test: function(component){40 var cmp = component.find("grandchild");41 aura.test.assertTrue(cmp.isInstanceOf("auratest:testInterfaceGrandchild"), "missing intf");42 aura.test.assertTrue(cmp.isInstanceOf("auratest:testInterfaceChild"), "missing parent intf");43 aura.test.assertTrue(cmp.isInstanceOf("auratest:testInterface"), "missing grandparent intf");44 aura.test.assertFalse(cmp.isInstanceOf("auratest:testInterface2"), "extra intf");45 }46 },47 /**48 */49 testExtendsFromSingleExtendedInterface: {50 test: function(component){51 var cmp = component.find("stepchild");52 aura.test.assertTrue(cmp.isInstanceOf("auratest:testInterfaceChild"), "missing intf");53 aura.test.assertTrue(cmp.isInstanceOf("auratest:testInterface"), "missing parent intf");54 aura.test.assertTrue(cmp.isInstanceOf("auratest:testInterface2"), "missing additional intf");55 aura.test.assertFalse(cmp.isInstanceOf("auratest:testInterfaceGrandchild"), "extra intf");56 }57 },58 /**59 */60 testExtraExtendsFromSingleExtendedInterface: {61 test: function(component){62 var cmp = component.find("stepgrandchild");63 aura.test.assertTrue(cmp.isInstanceOf("auratest:testInterfaceChild"), "missing intf");64 aura.test.assertTrue(cmp.isInstanceOf("auratest:testInterface"), "missing parent intf");65 aura.test.assertTrue(cmp.isInstanceOf("auratest:testInterface2"), "missing additional intf");66 aura.test.assertFalse(cmp.isInstanceOf("auratest:testInterfaceGrandchild"), "extra intf");67 }68 },69 /**70 */71 testHasMultipleInterfaces: {72 test: function(component){73 var cmp = component.find("multiple");74 aura.test.assertTrue(cmp.isInstanceOf("auratest:testInterface"), "missing first intf");75 aura.test.assertTrue(cmp.isInstanceOf("auratest:testInterface2"), "missing second intf");76 aura.test.assertTrue(cmp.isInstanceOf("auratest:test_Instantiate_Interface"), "missing third intf");77 aura.test.assertFalse(cmp.isInstanceOf("auratest:testInterfaceChild"), "extra child intf");78 }79 },80 /**81 */82 testInvalidArguments: {83 test: function(component){84 aura.test.assertFalse(component.isInstanceOf(), "no input");85 aura.test.assertFalse(component.isInstanceOf(null), "null input");86 aura.test.assertFalse(component.isInstanceOf(undefined), "undefined input");87 aura.test.assertFalse(component.isInstanceOf(""), "empty string");88 aura.test.assertFalse(component.isInstanceOf("x"), "invalid name");89 aura.test.assertFalse(component.isInstanceOf("blaggah:testUnknownInterface"), "unknown namespace");90 aura.test.assertFalse(component.isInstanceOf("auratest:testUnknownInterface"), "unknown component");91 }92 },93 /**94 * isInstanceOf works for component with no interfaces.95 */96 testNoInterfaces: {97 test: function(component){98 var cmp = component.find("none");99 $A.log(cmp.getDef());100 aura.test.assertFalse(cmp.isInstanceOf("auratest:testInterface"), "unexpected first intf");101 aura.test.assertFalse(cmp.isInstanceOf("auratest:testInterface2"), "unexpected second intf");102 aura.test.assertFalse(cmp.isInstanceOf("auratest:test_Instantiate_Interface"), "unexpected third intf");103 aura.test.assertFalse(cmp.isInstanceOf("auratest:testInterfaceChild"), "unexpected child intf");104 }105 }...
Using AI Code Generation
1const { isInstanceOf } = require('stryker-parent');2class A {}3class B extends A {}4class C extends B {}5const a = new A();6const b = new B();7const c = new C();8console.log(isInstanceOf(undefined, 'hello'));
Using AI Code Generation
1const strykerParent = require('stryker-parent');2const child = new strykerParent.Child();3const parent = new strykerParent.Parent();4const strykerParent = require('stryker-parent');5const child = new strykerParent.Child();6const child2 = new strykerParent.Child();
Using AI Code Generation
1import { isInstanceOf } from 'stryker-parent';2import { ChildProcess } from 'child_process';3const childProcess = new ChildProcess();4import { isInstanceOf } from 'stryker-child';5import { ChildProcess } from 'child_process';6const childProcess = new ChildProcess();7How to create a child process in Node.js using child_process.spawn() ?8How to create a child process in Node.js using child_process.exec() ?9How to create a child process in Node.js using child_process.fork() ?10How to create a child process in Node.js using child_process.execFile() ?11How to create a child process in Node.js using child_process.execFileSync() ?12How to create a child process in Node.js using child_process.spawnSync() ?13How to create a child process in Node.js using child_process.execSync() ?14How to create a child process in Node.js using child_process.fork() ?15How to create a child process in Node.js using child_process.execFile() ?16How to create a child process in Node.js using child_process.execFileSync() ?17How to create a child process in Node.js using child_process.spawnSync() ?18How to create a child process in Node.js using child_process.execSync() ?19How to create a child process in Node.js using child_process.fork() ?20How to create a child process in Node.js using child_process.execFile() ?21How to create a child process in Node.js using child_process.execFileSync() ?22How to create a child process in Node.js using child_process.spawnSync() ?23How to create a child process in Node.js using child_process.execSync() ?24How to create a child process in Node.js using child_process.fork() ?25How to create a child process in Node.js using child_process.execFile() ?26How to create a child process in Node.js using child_process.execFileSync() ?
Using AI Code Generation
1var stryker = require('stryker-parent');2var assert = require('assert');3assert(stryker.isInstanceOf(1, Number));4var stryker = require('stryker-parent');5var assert = require('assert');6assert(stryker.isInstanceOf(1, Number));7at Function.Module._resolveFilename (module.js:336:15)8at Function.Module._load (module.js:286:25)9at Module.require (module.js:365:17)10at require (module.js:384:17)11at Object. (/Users/.../test.js:1:14)12at Module._compile (module.js:460:26)13at Object.Module._extensions..js (module.js:478:10)14at Module.load (module.js:355:32)15at Function.Module._load (module.js:310:12)16at Function.Module.runMain (module.js:501:10)17at startup (node.js:129:16)
Using AI Code Generation
1var strykerParent = require("stryker-parent");2var test = function(){3 return strykerParent.isInstanceOf("test");4};5var strykerParent = require("stryker-parent");6var test2 = function(){7 return strykerParent.isInstanceOf("test2");8};9var strykerParent = require("stryker-parent");10var test3 = function(){11 return strykerParent.isInstanceOf("test3");12};13var strykerParent = require("stryker-parent");14var test4 = function(){15 return strykerParent.isInstanceOf("test4");16};17module.exports = {18};19var strykerParent = require("stryker-parent");20var test5 = function(){21 return strykerParent.isInstanceOf("test5");22};23module.exports = {24};25var strykerParent = require("stryker-parent");26var test6 = function(){27 return strykerParent.isInstanceOf("test6");28};29module.exports = {30};31var strykerParent = require("stryker-parent");32var test7 = function(){33 return strykerParent.isInstanceOf("test7");34};35module.exports = {36};37var strykerParent = require("stryker-parent");38var test8 = function(){39 return strykerParent.isInstanceOf("test8");40};41module.exports = {42};
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!!