How to use errorStub method in stryker-parent

Best JavaScript code snippet using stryker-parent

hierarchy_validation_test.mocha.js

Source:hierarchy_validation_test.mocha.js Github

copy

Full Screen

1/**2 * @license3 * Copyright 2020 Google LLC4 * SPDX-License-Identifier: Apache-2.05 */6/**7 * @fileoverview Unit tests for validation of a type hierarchy definition.8 */9const chai = require('chai');10const sinon = require('sinon');11const {validateHierarchy} = require('../src/hierarchy_validation.js');12const {MissingTypeNameError, LeftBracketError,13 RightBracketError, ExtraCharactersError} =14 require('../src/type_structure.js');15suite('Hierarchy Validation', function() {16 setup(function() {17 this.errorStub = sinon.stub(console, 'error');18 });19 teardown(function() {20 this.errorStub.restore();21 });22 suite('Correct type', function() {23 test('Object', function() {24 validateHierarchy({});25 chai.assert.isTrue(this.errorStub.notCalled);26 });27 test('Undefined', function() {28 validateHierarchy();29 chai.assert.isTrue(this.errorStub.calledOnce);30 chai.assert.isTrue(this.errorStub.calledWith(31 'The hierarchy definition should be an object.'));32 });33 test('Array', function() {34 validateHierarchy([]);35 chai.assert.isTrue(this.errorStub.calledOnce);36 chai.assert.isTrue(this.errorStub.calledWith(37 'The hierarchy definition should be an object.'));38 });39 });40 suite('Conflicts', function() {41 const conflictMsg =42 'The type name \'%s\' conflicts with the type name(s) [%s]';43 test('No conflicts', function() {44 validateHierarchy({45 'typeA': { },46 'typeB': { },47 'typeC': { },48 });49 chai.assert.isTrue(this.errorStub.notCalled);50 });51 test('Type conflicts once', function() {52 validateHierarchy({53 'typeA': { },54 'TypeA': { },55 });56 chai.assert.isTrue(this.errorStub.calledOnce);57 chai.assert.isTrue(this.errorStub.calledWith(58 conflictMsg, 'typeA', 'TypeA'));59 });60 test('Type conflicts multiple', function() {61 validateHierarchy({62 'typeA': { },63 'TypeA': { },64 'Typea': { },65 });66 chai.assert.isTrue(this.errorStub.calledOnce);67 chai.assert.isTrue(this.errorStub.calledWith(68 conflictMsg, 'typeA', 'TypeA, Typea'));69 });70 test('Multiple conflicts', function() {71 validateHierarchy({72 'typeA': { },73 'TypeA': { },74 'typeB': { },75 'TypeB': { },76 });77 chai.assert.isTrue(this.errorStub.calledTwice);78 chai.assert.isTrue(this.errorStub.calledWith(79 conflictMsg, 'typeA', 'TypeA'));80 chai.assert.isTrue(this.errorStub.calledWith(81 conflictMsg, 'typeB', 'TypeB'));82 });83 });84 suite('Defined supers', function() {85 const errorMsg = 'The type %s says it fulfills the type %s, but that' +86 ' type is not defined.';87 const genericMsg = 'The type %s says it fulfills the type %s, but that ' +88 'type appears to be generic, which is not allowed.';89 test('Defined before', function() {90 validateHierarchy({91 'typeB': { },92 'typeA': {93 'fulfills': ['typeB'],94 },95 });96 chai.assert.isTrue(this.errorStub.notCalled);97 });98 test('Defined after', function() {99 validateHierarchy({100 'typeA': {101 'fulfills': ['typeB'],102 },103 'typeB': { },104 });105 chai.assert.isTrue(this.errorStub.notCalled);106 });107 test('Not defined', function() {108 validateHierarchy({109 'typeA': {110 'fulfills': ['typeB'],111 },112 });113 chai.assert.isTrue(this.errorStub.calledOnce);114 chai.assert.isTrue(this.errorStub.calledWith(errorMsg, 'typeA', 'typeB'));115 });116 test('Case', function() {117 validateHierarchy({118 'typeB': { },119 'typeA': {120 'fulfills': ['TypeB'],121 },122 });123 chai.assert.isTrue(this.errorStub.notCalled);124 });125 test('Defined with params', function() {126 validateHierarchy({127 'typeA': {128 'fulfills': ['typeB[A]'],129 'params': [130 {131 'name': 'A',132 'variance': 'co',133 },134 ],135 },136 'typeB': {137 'params': [138 {139 'name': 'A',140 'variance': 'co',141 },142 ],143 },144 });145 chai.assert.isTrue(this.errorStub.notCalled);146 });147 test('Undefined with params', function() {148 validateHierarchy({149 'typeA': {150 'fulfills': ['typeB[A]'],151 'params': [152 {153 'name': 'A',154 'variance': 'co',155 },156 ],157 },158 });159 chai.assert.isTrue(this.errorStub.calledOnce);160 chai.assert.isTrue(this.errorStub.calledWith(errorMsg, 'typeA', 'typeB'));161 });162 test('Generic super', function() {163 validateHierarchy({164 'typeA': {165 'fulfills': ['A'],166 },167 });168 chai.assert.isTrue(this.errorStub.calledOnce);169 chai.assert.isTrue(170 this.errorStub.calledWith(genericMsg, 'typeA', 'A'));171 });172 });173 suite('Duplicate supers', function() {174 const errorMsg = 'The type %s fulfills the type %s multiple times.';175 test('Simple', function() {176 validateHierarchy({177 'typeA': { },178 'typeB': {179 'fulfills': ['typeA', 'typeA'],180 },181 });182 chai.assert.isTrue(this.errorStub.calledOnce);183 chai.assert.isTrue(this.errorStub.calledWith(errorMsg, 'typeB', 'typeA'));184 });185 test('Case', function() {186 validateHierarchy({187 'typeA': { },188 'typeB': {189 'fulfills': ['typea', 'typeA'],190 },191 });192 chai.assert.isTrue(this.errorStub.calledOnce);193 chai.assert.isTrue(this.errorStub.calledWith(errorMsg, 'typeB', 'typeA'));194 });195 test('Params', function() {196 validateHierarchy({197 'typeA': {198 'params': [199 {200 'name': 'A',201 'variance': 'co',202 },203 ],204 },205 'typeB': {206 'fulfills': ['typeA[A]', 'typeA[B]'],207 'params': [208 {209 'name': 'A',210 'variance': 'co',211 },212 {213 'name': 'B',214 'variance': 'co',215 },216 ],217 },218 });219 chai.assert.isTrue(this.errorStub.calledOnce);220 chai.assert.isTrue(this.errorStub.calledWith(errorMsg, 'typeB', 'typeA'));221 });222 });223 suite('Circular dependencies', function() {224 test('No cycles', function() {225 validateHierarchy({226 'typeA': {227 'fulfills': ['typeB'],228 },229 'typeB': {230 'fulfills': ['typeC'],231 },232 'typeC': {233 'fulfills': ['typeD'],234 },235 'typeD': {236 'fulfills': ['typeE'],237 },238 'typeE': { },239 });240 chai.assert.isTrue(this.errorStub.notCalled);241 });242 test('Direct cycle', function() {243 validateHierarchy({244 'typeA': {245 'fulfills': ['typeA'],246 },247 });248 chai.assert.isTrue(this.errorStub.calledOnce);249 chai.assert.isTrue(this.errorStub.calledWith(250 'The type typeA creates a circular dependency: ' +251 'typeA fulfills typeA'));252 });253 test('Direct with case', function() {254 validateHierarchy({255 'typeA': {256 'fulfills': ['TypeA'],257 },258 });259 chai.assert.isTrue(this.errorStub.calledOnce);260 chai.assert.isTrue(this.errorStub.calledWith(261 'The type typeA creates a circular dependency: ' +262 'typeA fulfills TypeA'));263 });264 test('Direct w/ params', function() {265 validateHierarchy({266 'typeA': {267 'fulfills': ['typeA[A]'],268 'params': [269 {270 'name': 'A',271 'variance': 'co',272 },273 ],274 },275 });276 chai.assert.isTrue(this.errorStub.calledOnce);277 chai.assert.isTrue(this.errorStub.calledWith(278 'The type typeA creates a circular dependency: ' +279 'typeA fulfills typeA[A]'));280 });281 test('Indirect cycle', function() {282 validateHierarchy({283 'typeA': {284 'fulfills': ['typeB'],285 },286 'typeB': {287 'fulfills': ['typeA'],288 },289 });290 chai.assert.isTrue(this.errorStub.calledOnce);291 chai.assert.isTrue(this.errorStub.calledWith(292 'The type typeA creates a circular dependency: ' +293 'typeA fulfills typeB fulfills typeA'));294 });295 test('Indirect cycle w/ params', function() {296 validateHierarchy({297 'typeA': {298 'fulfills': ['typeB[A]'],299 'params': [300 {301 'name': 'A',302 'variance': 'co',303 },304 ],305 },306 'typeB': {307 'fulfills': ['typeA[B]'],308 'params': [309 {310 'name': 'B',311 'variance': 'co',312 },313 ],314 },315 });316 chai.assert.isTrue(this.errorStub.calledOnce);317 chai.assert.isTrue(this.errorStub.calledWith(318 'The type typeA creates a circular dependency: ' +319 'typeA fulfills typeB[A] fulfills typeA[B]'));320 });321 test('Indirect cycle w/ one param', function() {322 validateHierarchy({323 'typeA': {324 'fulfills': ['typeB[typeC]'],325 },326 'typeB': {327 'fulfills': ['typeA'],328 'params': [329 {330 'name': 'B',331 'variance': 'co',332 },333 ],334 },335 'typeC': { },336 });337 chai.assert.isTrue(this.errorStub.calledOnce);338 chai.assert.isTrue(this.errorStub.calledWith(339 'The type typeA creates a circular dependency: ' +340 'typeA fulfills typeB[typeC] fulfills typeA'));341 });342 test('Really indirect cycle', function() {343 validateHierarchy({344 'typeA': {345 'fulfills': ['typeB', 'typeC', 'typeD'],346 },347 'typeB': {348 'fulfills': ['typeE'],349 },350 'typeC': {351 'fulfills': ['typeF', 'typeG'],352 },353 'typeD': {354 'fulfills': ['typeH', 'typeJ'],355 },356 'typeE': { },357 'typeF': { },358 'typeG': { },359 'typeH': { },360 'typeJ': {361 'fulfills': ['typeA'],362 },363 });364 chai.assert.isTrue(this.errorStub.calledOnce);365 chai.assert.isTrue(this.errorStub.calledWith(366 'The type typeA creates a circular dependency: ' +367 'typeA fulfills typeD fulfills typeJ fulfills typeA'));368 });369 test('Two divergent cycles', function() {370 validateHierarchy({371 'typeA': {372 'fulfills': ['typeB', 'typeC'],373 },374 'typeB': {375 'fulfills': ['typeA'],376 },377 'typeC': {378 'fulfills': ['typeA'],379 },380 });381 chai.assert.isTrue(this.errorStub.calledTwice);382 chai.assert.isTrue(this.errorStub.calledWith(383 'The type typeA creates a circular dependency: ' +384 'typeA fulfills typeB fulfills typeA'));385 chai.assert.isTrue(this.errorStub.calledWith(386 'The type typeA creates a circular dependency: ' +387 'typeA fulfills typeC fulfills typeA'));388 });389 test('Two convergent cycles', function() {390 validateHierarchy({391 'typeA': {392 'fulfills': ['typeC'],393 },394 'typeB': {395 'fulfills': ['typeC'],396 },397 'typeC': {398 'fulfills': ['typeA', 'typeB'],399 },400 });401 chai.assert.isTrue(this.errorStub.calledTwice);402 chai.assert.isTrue(this.errorStub.calledWith(403 'The type typeA creates a circular dependency: ' +404 'typeA fulfills typeC fulfills typeA'));405 chai.assert.isTrue(this.errorStub.calledWith(406 'The type typeC creates a circular dependency: ' +407 'typeC fulfills typeB fulfills typeC'));408 });409 test('Two independent cycles', function() {410 validateHierarchy({411 'typeA': {412 'fulfills': ['typeB'],413 },414 'typeB': {415 'fulfills': ['typeA'],416 },417 'typeC': {418 'fulfills': ['typeD'],419 },420 'typeD': {421 'fulfills': ['typeC'],422 },423 });424 chai.assert.isTrue(this.errorStub.calledTwice);425 chai.assert.isTrue(this.errorStub.calledWith(426 'The type typeA creates a circular dependency: ' +427 'typeA fulfills typeB fulfills typeA'));428 chai.assert.isTrue(this.errorStub.calledWith(429 'The type typeC creates a circular dependency: ' +430 'typeC fulfills typeD fulfills typeC'));431 });432 });433 suite('Generics', function() {434 const errorMsg = 'The type %s will act like a generic type if used as a ' +435 'connection check, because it is a single character.';436 test('"valid"', function() {437 validateHierarchy({438 'valid': { },439 });440 chai.assert.isTrue(this.errorStub.notCalled);441 });442 test('"123"', function() {443 validateHierarchy({444 '123': { },445 });446 chai.assert.isTrue(this.errorStub.notCalled);447 });448 test('"a"', function() {449 validateHierarchy({450 'a': { },451 });452 chai.assert.isTrue(this.errorStub.calledOnce);453 chai.assert.isTrue(this.errorStub.calledWith(errorMsg, 'a'));454 });455 test('"A"', function() {456 validateHierarchy({457 'A': { },458 });459 chai.assert.isTrue(this.errorStub.calledOnce);460 chai.assert.isTrue(this.errorStub.calledWith(errorMsg, 'A'));461 });462 test('"*"', function() {463 validateHierarchy({464 '*': { },465 });466 chai.assert.isTrue(this.errorStub.calledOnce);467 chai.assert.isTrue(this.errorStub.calledWith(errorMsg, '*'));468 });469 test('"1"', function() {470 validateHierarchy({471 '1': { },472 });473 chai.assert.isTrue(this.errorStub.calledOnce);474 chai.assert.isTrue(this.errorStub.calledWith(errorMsg, '1'));475 });476 });477 suite('Characters', function() {478 setup(function() {479 const errorMsg = 'The type %s includes an illegal %s character (\'%s\').';480 this.assertValid = function(hierarchy) {481 validateHierarchy(hierarchy);482 chai.assert.isTrue(this.errorStub.notCalled);483 };484 this.assertInvalid = function(hierarchy, type, char, charName) {485 validateHierarchy(hierarchy);486 chai.assert.isTrue(this.errorStub.calledOnce);487 chai.assert.isTrue(488 this.errorStub.calledWith(errorMsg, type, charName, char));489 };490 });491 test('Comma', function() {492 this.assertInvalid({493 'type,type': { },494 }, 'type,type', ',', 'comma');495 });496 test('Space', function() {497 this.assertInvalid({498 'type type': { },499 }, 'type type', ' ', 'space');500 });501 test('Left bracket', function() {502 this.assertInvalid({503 'type[': { },504 }, 'type[', '[', 'left bracket');505 });506 test('Right bracket', function() {507 this.assertInvalid({508 'type]': { },509 }, 'type]', ']', 'right bracket');510 });511 });512 suite('Supers parsing', function() {513 setup(function() {514 this.assertInvalid = function(hierarchy, errorType) {515 validateHierarchy(hierarchy);516 chai.assert.isTrue(this.errorStub.calledOnce);517 chai.assert.isTrue(518 this.errorStub.getCall(0).args[3] instanceof errorType);519 };520 });521 test('Missing type name', function() {522 this.assertInvalid({523 'typeA': {524 'fulfills': ['[typeB]'],525 },526 'typeB': { },527 }, MissingTypeNameError);528 });529 test('Unmatched left', function() {530 this.assertInvalid({531 'typeA': {532 'fulfills': ['typeB['],533 },534 'typeB': { },535 }, LeftBracketError);536 });537 test('Unmatched right', function() {538 this.assertInvalid({539 'typeA': {540 'fulfills': ['typeB]'],541 },542 'typeB': { },543 }, RightBracketError);544 });545 test('Extra characters', function() {546 this.assertInvalid({547 'typeA': {548 'fulfills': ['typeB[typeB]test'],549 },550 'typeB': { },551 }, ExtraCharactersError);552 });553 });554 suite('Super params defined', function() {555 setup(function() {556 this.assertInvalid = function(hierarchyDef, generic, badParam) {557 validateHierarchy(hierarchyDef);558 chai.assert.isTrue(this.errorStub.calledOnce);559 chai.assert.isTrue(this.errorStub.getCall(0).args[3] == badParam);560 const includes = this.errorStub.getCall(0).args[0].includes('generic');561 if (generic) {562 chai.assert.isTrue(563 includes, 'Expected the error to be for a generic param.');564 } else {565 chai.assert.isFalse(566 includes, 'Expected the error to be for an explicit param.');567 }568 };569 this.assertValid = function(hierarchyDef) {570 validateHierarchy(hierarchyDef);571 chai.assert.isTrue(this.errorStub.notCalled);572 };573 });574 test('Undefined explicit', function() {575 this.assertInvalid({576 'typeA': {577 'fulfills': ['typeB[typeC]'],578 },579 'typeB': {580 'params': [581 {582 'name': 'B',583 'variance': 'co',584 },585 ],586 },587 }, false, 'typeC');588 });589 test('Defined explicit, case', function() {590 this.assertValid({591 'typeA': {592 'fulfills': ['typeB[TYPEC]'],593 },594 'typeB': {595 'params': [596 {597 'name': 'B',598 'variance': 'co',599 },600 ],601 },602 'typeC': { },603 });604 });605 test('Undefined nested explicit', function() {606 this.assertInvalid({607 'typeA': {608 'fulfills': ['typeB[typeB[typeC]]'],609 },610 'typeB': {611 'params': [612 {613 'name': 'B',614 'variance': 'co',615 },616 ],617 },618 }, false, 'typeC');619 });620 test('Undefined generic', function() {621 this.assertInvalid({622 'typeA': {623 'fulfills': ['typeB[A]'],624 'params': [625 {626 'name': 'B',627 'variance': 'co',628 },629 ],630 },631 'typeB': {632 'params': [633 {634 'name': 'B',635 'variance': 'co',636 },637 ],638 },639 }, true, 'A');640 });641 test('Undefined generic, no params', function() {642 this.assertInvalid({643 'typeA': {644 'fulfills': ['typeB[A]'],645 },646 'typeB': {647 'params': [648 {649 'name': 'B',650 'variance': 'co',651 },652 ],653 },654 }, true, 'A');655 });656 test('Defined generic', function() {657 this.assertValid({658 'typeA': {659 'fulfills': ['typeB[A]'],660 'params': [661 {662 'name': 'A',663 'variance': 'co',664 },665 ],666 },667 'typeB': {668 'params': [669 {670 'name': 'B',671 'variance': 'co',672 },673 ],674 },675 'typeC': { },676 });677 });678 test('Defined generic, case', function() {679 this.assertValid({680 'typeA': {681 'fulfills': ['typeB[a]'],682 'params': [683 {684 'name': 'A',685 'variance': 'co',686 },687 ],688 },689 'typeB': {690 'params': [691 {692 'name': 'B',693 'variance': 'co',694 },695 ],696 },697 'typeC': { },698 });699 });700 test('Undefined nested generic', function() {701 this.assertInvalid({702 'typeA': {703 'fulfills': ['typeB[typeB[A]]'],704 'params': [705 {706 'name': 'B',707 'variance': 'co',708 },709 ],710 },711 'typeB': {712 'params': [713 {714 'name': 'B',715 'variance': 'co',716 },717 ],718 },719 }, true, 'A');720 });721 });722 suite('Super param numbers correct', function() {723 const errorMsg = 'The type %s says it fulfills the type %s, but %s ' +724 'requires %s type(s) while %s type(s) are provided.';725 const genericErrorMsg = 'The type %s says it fulfills the type %s, but ' +726 '%s appears to be generic and have parameters, which is not allowed.';727 test('Too many params, 0', function() {728 validateHierarchy({729 'typeA': {730 'fulfills': ['typeB[A]'],731 'params': [732 {733 'name': 'A',734 'variance': 'co',735 },736 ],737 },738 'typeB': { },739 });740 chai.assert.isTrue(this.errorStub.calledOnce);741 chai.assert.isTrue(this.errorStub.calledWith(errorMsg,742 'typeA', 'typeB[A]', 'typeB', 0, 1));743 });744 test('Too many params, 1', function() {745 validateHierarchy({746 'typeA': {747 'fulfills': ['typeB[A, B]'],748 'params': [749 {750 'name': 'A',751 'variance': 'co',752 },753 {754 'name': 'B',755 'variance': 'co',756 },757 ],758 },759 'typeB': {760 'params': [761 {762 'name': 'T',763 'variance': 'co',764 },765 ],766 },767 });768 chai.assert.isTrue(this.errorStub.calledOnce);769 chai.assert.isTrue(this.errorStub.calledWith(errorMsg,770 'typeA', 'typeB[A, B]', 'typeB', 1, 2));771 });772 test('Nested too many params', function() {773 validateHierarchy({774 'typeA': {775 'fulfills': ['typeB[typeB[A, B]]'],776 'params': [777 {778 'name': 'A',779 'variance': 'co',780 },781 {782 'name': 'B',783 'variance': 'co',784 },785 ],786 },787 'typeB': {788 'params': [789 {790 'name': 'T',791 'variance': 'co',792 },793 ],794 },795 });796 chai.assert.isTrue(this.errorStub.calledOnce);797 chai.assert.isTrue(this.errorStub.calledWith(errorMsg,798 'typeA', 'typeB[typeB[A, B]]', 'typeB', 1, 2));799 });800 test('Too few params, 0', function() {801 validateHierarchy({802 'typeA': {803 'fulfills': ['typeB'],804 },805 'typeB': {806 'params': [807 {808 'name': 'T',809 'variance': 'co',810 },811 ],812 },813 });814 chai.assert.isTrue(this.errorStub.calledOnce);815 chai.assert.isTrue(this.errorStub.calledWith(errorMsg,816 'typeA', 'typeB', 'typeB', 1, 0));817 });818 test('Two few params, 1', function() {819 validateHierarchy({820 'typeA': {821 'fulfills': ['typeB[A]'],822 'params': [823 {824 'name': 'A',825 'variance': 'co',826 },827 ],828 },829 'typeB': {830 'params': [831 {832 'name': 'T',833 'variance': 'co',834 },835 {836 'name': 'U',837 'variance': 'co',838 },839 ],840 },841 });842 chai.assert.isTrue(this.errorStub.calledOnce);843 chai.assert.isTrue(this.errorStub.calledWith(errorMsg,844 'typeA', 'typeB[A]', 'typeB', 2, 1));845 });846 test('Nested too few params', function() {847 validateHierarchy({848 'typeA': {849 'fulfills': ['typeB[typeC, typeB[A]]'],850 'params': [851 {852 'name': 'A',853 'variance': 'co',854 },855 ],856 },857 'typeB': {858 'params': [859 {860 'name': 'T',861 'variance': 'co',862 },863 {864 'name': 'U',865 'variance': 'co',866 },867 ],868 },869 'typeC': { },870 });871 chai.assert.isTrue(this.errorStub.calledOnce);872 chai.assert.isTrue(this.errorStub.calledWith(errorMsg,873 'typeA', 'typeB[typeC, typeB[A]]', 'typeB', 2, 1));874 });875 test('Generic param with params', function() {876 validateHierarchy({877 'typeA': {878 'fulfills': ['typeB[A[typeC]]'],879 'params': [880 {881 'name': 'A',882 'variance': 'co',883 },884 ],885 },886 'typeB': {887 'params': [888 {889 'name': 'T',890 'variance': 'co',891 },892 ],893 },894 'typeC': { },895 });896 chai.assert.isTrue(this.errorStub.calledOnce);897 chai.assert.isTrue(this.errorStub.calledWith(genericErrorMsg,898 'typeA', 'typeB[A[typeC]]', 'A'));899 });900 });901 suite('Super param variances correct', function() {902 setup(function() {903 this.assertInvalid = function(hierarchy, ...includes) {904 validateHierarchy(hierarchy);905 chai.assert.isTrue(this.errorStub.calledOnce);906 const arg = this.errorStub.getCall(0).args[0];907 for (const str of includes) {908 chai.assert.isTrue(arg.includes(str));909 }910 };911 this.assertValid = function(hierarchy) {912 validateHierarchy(hierarchy);913 chai.assert.isTrue(this.errorStub.notCalled);914 };915 });916 test('Bad variance', function() {917 });918 test('Co and co', function() {919 this.assertValid({920 'typeA': {921 'fulfills': ['typeB[A]'],922 'params': [923 {924 'name': 'A',925 'variance': 'co',926 },927 ],928 },929 'typeB': {930 'params': [931 {932 'name': 'B',933 'variance': 'co',934 },935 ],936 },937 });938 });939 test('Co and contra', function() {940 this.assertInvalid({941 'typeA': {942 'fulfills': ['typeB[A]'],943 'params': [944 {945 'name': 'A',946 'variance': 'contra',947 },948 ],949 },950 'typeB': {951 'params': [952 {953 'name': 'B',954 'variance': 'co',955 },956 ],957 },958 }, 'covariant', 'contravariant');959 });960 test('Co and inv', function() {961 this.assertValid({962 'typeA': {963 'fulfills': ['typeB[A]'],964 'params': [965 {966 'name': 'A',967 'variance': 'inv',968 },969 ],970 },971 'typeB': {972 'params': [973 {974 'name': 'B',975 'variance': 'co',976 },977 ],978 },979 });980 });981 test('Contra and co', function() {982 this.assertInvalid({983 'typeA': {984 'fulfills': ['typeB[A]'],985 'params': [986 {987 'name': 'A',988 'variance': 'co',989 },990 ],991 },992 'typeB': {993 'params': [994 {995 'name': 'B',996 'variance': 'contra',997 },998 ],999 },1000 }, 'contravariant', 'covariant');1001 });1002 test('Contra and contra', function() {1003 this.assertValid({1004 'typeA': {1005 'fulfills': ['typeB[A]'],1006 'params': [1007 {1008 'name': 'A',1009 'variance': 'contra',1010 },1011 ],1012 },1013 'typeB': {1014 'params': [1015 {1016 'name': 'B',1017 'variance': 'contra',1018 },1019 ],1020 },1021 });1022 });1023 test('Contra and inv', function() {1024 this.assertValid({1025 'typeA': {1026 'fulfills': ['typeB[A]'],1027 'params': [1028 {1029 'name': 'A',1030 'variance': 'inv',1031 },1032 ],1033 },1034 'typeB': {1035 'params': [1036 {1037 'name': 'B',1038 'variance': 'contra',1039 },1040 ],1041 },1042 });1043 });1044 test('Inv and co', function() {1045 this.assertInvalid({1046 'typeA': {1047 'fulfills': ['typeB[A]'],1048 'params': [1049 {1050 'name': 'A',1051 'variance': 'co',1052 },1053 ],1054 },1055 'typeB': {1056 'params': [1057 {1058 'name': 'B',1059 'variance': 'inv',1060 },1061 ],1062 },1063 }, 'invariant', 'covariant');1064 });1065 test('Inv and contra', function() {1066 this.assertInvalid({1067 'typeA': {1068 'fulfills': ['typeB[A]'],1069 'params': [1070 {1071 'name': 'A',1072 'variance': 'contra',1073 },1074 ],1075 },1076 'typeB': {1077 'params': [1078 {1079 'name': 'B',1080 'variance': 'inv',1081 },1082 ],1083 },1084 }, 'invariant', 'contravariant');1085 });1086 test('Inv and inv', function() {1087 this.assertValid({1088 'typeA': {1089 'fulfills': ['typeB[A]'],1090 'params': [1091 {1092 'name': 'A',1093 'variance': 'inv',1094 },1095 ],1096 },1097 'typeB': {1098 'params': [1099 {1100 'name': 'B',1101 'variance': 'inv',1102 },1103 ],1104 },1105 });1106 });1107 test('Nested bad variance', function() {1108 this.assertInvalid({1109 'typeA': {1110 'fulfills': ['typeB[typeB[A]]'],1111 'params': [1112 {1113 'name': 'A',1114 'variance': 'co',1115 },1116 ],1117 },1118 'typeB': {1119 'params': [1120 {1121 'name': 'B',1122 'variance': 'inv',1123 },1124 ],1125 },1126 }, 'invariant', 'covariant');1127 });1128 });1129 suite('Variances', function() {1130 test('Valid', function() {1131 validateHierarchy({1132 'typeA': {1133 'params': [1134 {1135 'name': 'A',1136 'variance': 'co',1137 },1138 {1139 'name': 'B',1140 'variance': 'contra',1141 },1142 {1143 'name': 'C',1144 'variance': 'inv',1145 },1146 ],1147 },1148 });1149 chai.assert.isTrue(this.errorStub.notCalled);1150 });1151 test('Valid, case', function() {1152 validateHierarchy({1153 'typeA': {1154 'params': [1155 {1156 'name': 'A',1157 'variance': 'CO',1158 },1159 {1160 'name': 'B',1161 'variance': 'CONTRA',1162 },1163 {1164 'name': 'C',1165 'variance': 'INV',1166 },1167 ],1168 },1169 });1170 chai.assert.isTrue(this.errorStub.notCalled);1171 });1172 test('Valid, extra', function() {1173 validateHierarchy({1174 'typeA': {1175 'params': [1176 {1177 'name': 'A',1178 'variance': 'covariant',1179 },1180 {1181 'name': 'B',1182 'variance': 'contravariant',1183 },1184 {1185 'name': 'C',1186 'variance': 'invariant',1187 },1188 ],1189 },1190 });1191 chai.assert.isTrue(this.errorStub.notCalled);1192 });1193 test('Not provided', function() {1194 const noVarianceMsg = 'The parameter %s of %s does not declare a ' +1195 'variance, which is required.';1196 validateHierarchy({1197 'typeA': {1198 'params': [1199 {1200 'name': 'A',1201 },1202 ],1203 },1204 });1205 chai.assert.isTrue(this.errorStub.calledOnce);1206 chai.assert.isTrue(1207 this.errorStub.calledWith(noVarianceMsg, 'A', 'typeA'));1208 });1209 test('Invalid', function() {1210 const errorMsg = 'The parameter %s of %s threw the following error: %s';1211 validateHierarchy({1212 'typeA': {1213 'params': [1214 {1215 'name': 'A',1216 'variance': 'test',1217 },1218 ],1219 },1220 });1221 chai.assert.isTrue(this.errorStub.calledOnce);1222 chai.assert.isTrue(1223 this.errorStub.calledWith(errorMsg, 'A', 'typeA'));1224 });1225 });1226 suite('Param names', function() {1227 test('Not provided', function() {1228 const noNameMsg = 'Parameter #%s of %s does not declare a name, which ' +1229 'is required.';1230 validateHierarchy({1231 'typeA': {1232 'params': [1233 {1234 'variance': 'co',1235 },1236 ],1237 },1238 });1239 chai.assert.isTrue(this.errorStub.calledOnce);1240 chai.assert.isTrue(this.errorStub.calledWith(noNameMsg, 1, 'typeA'));1241 });1242 test('Invalid', function() {1243 const errorMsg = 'The parameter name %s of %s is invalid. Parameter ' +1244 'names must be a single character.';1245 validateHierarchy({1246 'typeA': {1247 'params': [1248 {1249 'name': 'test',1250 'variance': 'co',1251 },1252 ],1253 },1254 });1255 chai.assert.isTrue(this.errorStub.calledOnce);1256 chai.assert.isTrue(this.errorStub.calledWith(errorMsg, 'test', 'typeA'));1257 });1258 });1259 suite('Conflicting param names', function() {1260 const conflictMsg = 'The param name %s in %s conflicts with the ' +1261 'param(s) [%s]';1262 test('Param conflicts once', function() {1263 this.errorStub.callsFake((...params) => console.log(params));1264 validateHierarchy({1265 'typeA': {1266 'params': [1267 {1268 'name': 'A',1269 'variance': 'co',1270 },1271 {1272 'name': 'a',1273 'variance': 'co',1274 },1275 ],1276 },1277 });1278 chai.assert.isTrue(this.errorStub.calledOnce);1279 chai.assert.isTrue(1280 this.errorStub.calledWith(conflictMsg, 'A', 'typeA', '#2 (a)'));1281 });1282 test('Param conflicts multiple', function() {1283 validateHierarchy({1284 'typeA': {1285 'params': [1286 {1287 'name': 'A',1288 'variance': 'co',1289 },1290 {1291 'name': 'a',1292 'variance': 'co',1293 },1294 {1295 'name': 'A',1296 'variance': 'co',1297 },1298 ],1299 },1300 });1301 chai.assert.isTrue(this.errorStub.calledOnce);1302 chai.assert.isTrue(this.errorStub.calledWith(1303 conflictMsg, 'A', 'typeA', '#2 (a), #3 (A)'));1304 });1305 });1306 suite('Fulfills is array', function() {1307 const error = 'The type %s provides a `fulfills` property, but it is not ' +1308 'an array';1309 test('Array', function() {1310 validateHierarchy({1311 'typeA': {1312 'fulfills': ['typeB'],1313 },1314 'typeB': { },1315 });1316 chai.assert.isTrue(this.errorStub.notCalled);1317 });1318 test('Object', function() {1319 validateHierarchy({1320 'typeA': {1321 'fulfills': { },1322 },1323 });1324 chai.assert.isTrue(this.errorStub.calledOnce);1325 chai.assert.isTrue(this.errorStub.calledWith(error, 'typeA'));1326 });1327 test('String', function() {1328 validateHierarchy({1329 'typeA': {1330 'fulfills': 'typeB',1331 },1332 'typeB': { },1333 });1334 chai.assert.isTrue(this.errorStub.calledOnce);1335 chai.assert.isTrue(this.errorStub.calledWith(error, 'typeA'));1336 });1337 test('Number', function() {1338 validateHierarchy({1339 'typeA': {1340 'fulfills': 1,1341 },1342 });1343 chai.assert.isTrue(this.errorStub.calledOnce);1344 chai.assert.isTrue(this.errorStub.calledWith(error, 'typeA'));1345 });1346 });1347 suite('Params is array', function() {1348 const error = 'The type %s provides a `params` property, but it is not an' +1349 ' array';1350 test('Array', function() {1351 validateHierarchy({1352 'typeA': {1353 'params': [1354 {1355 'name': 'A',1356 'variance': 'co',1357 },1358 ],1359 },1360 });1361 chai.assert.isTrue(this.errorStub.notCalled);1362 });1363 test('Object', function() {1364 validateHierarchy({1365 'typeA': {1366 'params': {1367 'A': 'co',1368 },1369 },1370 });1371 chai.assert.isTrue(this.errorStub.calledOnce);1372 chai.assert.isTrue(this.errorStub.calledWith(error, 'typeA'));1373 });1374 test('String', function() {1375 validateHierarchy({1376 'typeA': {1377 'params': 'A:co',1378 },1379 });1380 chai.assert.isTrue(this.errorStub.calledOnce);1381 chai.assert.isTrue(this.errorStub.calledWith(error, 'typeA'));1382 });1383 test('Number', function() {1384 validateHierarchy({1385 'typeA': {1386 'params': 1,1387 },1388 });1389 chai.assert.isTrue(this.errorStub.calledOnce);1390 chai.assert.isTrue(this.errorStub.calledWith(error, 'typeA'));1391 });1392 });...

Full Screen

Full Screen

kibana.js

Source:kibana.js Github

copy

Full Screen

...42 try {43 assertVersion(settings);44 }45 catch (err) {46 errorStub(err);47 }48 expect(errorStub.called).to.be(false);49 });50 it('should throw an error if plugin does contain a version.', function () {51 const errorStub = sinon.stub();52 try {53 assertVersion(settings);54 }55 catch (err) {56 errorStub(err);57 }58 expect(errorStub.firstCall.args[0]).to.match(/plugin version not found/i);59 });60 it('should throw an error if plugin version does does not match kibana version', function () {61 const errorStub = sinon.stub();62 settings.plugins[0].version = '1.2.3.4';63 try {64 assertVersion(settings);65 }66 catch (err) {67 errorStub(err);68 }69 expect(errorStub.firstCall.args[0]).to.match(/incorrect version/i);70 });71 it('should not throw an error if plugin version matches kibana version', function () {72 const errorStub = sinon.stub();73 settings.plugins[0].version = '1.0.0';74 try {75 assertVersion(settings);76 }77 catch (err) {78 errorStub(err);79 }80 expect(errorStub.called).to.be(false);81 });82 it('should ignore version info after the dash in checks on valid version', function () {83 const errorStub = sinon.stub();84 settings.plugins[0].version = '1.0.0-foo-bar-version-1.2.3';85 try {86 assertVersion(settings);87 }88 catch (err) {89 errorStub(err);90 }91 expect(errorStub.called).to.be(false);92 });93 it('should ignore version info after the dash in checks on invalid version', function () {94 const errorStub = sinon.stub();95 settings.plugins[0].version = '2.0.0-foo-bar-version-1.2.3';96 try {97 assertVersion(settings);98 }99 catch (err) {100 errorStub(err);101 }102 expect(errorStub.firstCall.args[0]).to.match(/incorrect version/i);103 });104 });105 describe('existingInstall', function () {106 let testWorkingPath;107 let processExitStub;108 beforeEach(function () {109 processExitStub = sinon.stub(process, 'exit');110 testWorkingPath = join(__dirname, '.test.data');111 rimraf.sync(testWorkingPath);112 sinon.stub(logger, 'log');113 sinon.stub(logger, 'error');114 });...

Full Screen

Full Screen

cleanup.test.js

Source:cleanup.test.js Github

copy

Full Screen

1/*2 * Licensed to Elasticsearch B.V. under one or more contributor3 * license agreements. See the NOTICE file distributed with4 * this work for additional information regarding copyright5 * ownership. Elasticsearch B.V. licenses this file to you under6 * the Apache License, Version 2.0 (the "License"); you may7 * not use this file except in compliance with the License.8 * You may obtain a copy of the License at9 *10 * http://www.apache.org/licenses/LICENSE-2.011 *12 * Unless required by applicable law or agreed to in writing,13 * software distributed under the License is distributed on an14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY15 * KIND, either express or implied. See the License for the16 * specific language governing permissions and limitations17 * under the License.18 */19import sinon from 'sinon';20import fs from 'fs';21import del from 'del';22import { cleanPrevious, cleanArtifacts } from './cleanup';23import { Logger } from '../lib/logger';24describe('kibana cli', function () {25 describe('plugin installer', function () {26 describe('pluginCleaner', function () {27 const settings = {28 workingPath: 'dummy',29 };30 describe('cleanPrevious', function () {31 let errorStub;32 let logger;33 beforeEach(function () {34 errorStub = sinon.stub();35 logger = new Logger(settings);36 sinon.stub(logger, 'log');37 sinon.stub(logger, 'error');38 });39 afterEach(function () {40 logger.log.restore();41 logger.error.restore();42 fs.statSync.restore();43 del.sync.restore();44 });45 it('should resolve if the working path does not exist', function () {46 sinon.stub(del, 'sync');47 sinon.stub(fs, 'statSync').callsFake(() => {48 const error = new Error('ENOENT');49 error.code = 'ENOENT';50 throw error;51 });52 return cleanPrevious(settings, logger)53 .catch(errorStub)54 .then(function () {55 expect(errorStub.called).toBe(false);56 });57 });58 it('should rethrow any exception except ENOENT from fs.statSync', function () {59 sinon.stub(del, 'sync');60 sinon.stub(fs, 'statSync').throws(new Error('An Unhandled Error'));61 errorStub = sinon.stub();62 return cleanPrevious(settings, logger)63 .catch(errorStub)64 .then(function () {65 expect(errorStub.called).toBe(true);66 });67 });68 it('should log a message if there was a working directory', function () {69 sinon.stub(del, 'sync');70 sinon.stub(fs, 'statSync');71 return cleanPrevious(settings, logger)72 .catch(errorStub)73 .then(function () {74 expect(logger.log.calledWith('Found previous install attempt. Deleting...')).toBe(75 true76 );77 });78 });79 it('should rethrow any exception from del.sync', function () {80 sinon.stub(fs, 'statSync');81 sinon.stub(del, 'sync').throws(new Error('I am an error thrown by del'));82 errorStub = sinon.stub();83 return cleanPrevious(settings, logger)84 .catch(errorStub)85 .then(function () {86 expect(errorStub.called).toBe(true);87 });88 });89 it('should resolve if the working path is deleted', function () {90 sinon.stub(del, 'sync');91 sinon.stub(fs, 'statSync');92 return cleanPrevious(settings, logger)93 .catch(errorStub)94 .then(function () {95 expect(errorStub.called).toBe(false);96 });97 });98 });99 describe('cleanArtifacts', function () {100 beforeEach(function () {});101 afterEach(function () {102 del.sync.restore();103 });104 it('should attempt to delete the working directory', function () {105 sinon.stub(del, 'sync');106 cleanArtifacts(settings);107 expect(del.sync.calledWith(settings.workingPath)).toBe(true);108 });109 it('should swallow any errors thrown by del.sync', function () {110 sinon.stub(del, 'sync').throws(new Error('Something bad happened.'));111 expect(() => cleanArtifacts(settings)).not.toThrow();112 });113 });114 });115 });...

Full Screen

Full Screen

Using AI Code Generation

copy

Full Screen

1var errorStub = require('stryker-parent').errorStub;2var errorStub = require('stryker-parent').errorStub;3var errorStub = require('stryker-parent').errorStub;4var errorStub = require('stryker-parent').errorStub;5var errorStub = require('stryker-parent').errorStub;6var errorStub = require('stryker-parent').errorStub;7var errorStub = require('stryker-parent').errorStub;8var errorStub = require('stryker-parent').errorStub;9var errorStub = require('stryker-parent').errorStub;10var errorStub = require('stryker-parent').errorStub;11var errorStub = require('stryker-parent').errorStub;12var errorStub = require('stryker-parent').errorStub;13var errorStub = require('stryker-parent').errorStub;14var errorStub = require('stryker-parent').errorStub;15var errorStub = require('stryker-parent').errorStub;16var errorStub = require('stryker-parent').errorStub;17var errorStub = require('stryker-parent').errorStub;18var errorStub = require('stryker-parent

Full Screen

Using AI Code Generation

copy

Full Screen

1var errorStub = require('stryker-parent').errorStub;2errorStub('test error');3var errorStub = require('stryker-parent').errorStub;4errorStub('test error');5var errorStub = require('stryker-parent').errorStub;6errorStub('test error');7var errorStub = require('stryker-parent').errorStub;8errorStub('test error');9var errorStub = require('stryker-parent').errorStub;10errorStub('test error');11var errorStub = require('stryker-parent').errorStub;12errorStub('test error');13var errorStub = require('stryker-parent').errorStub;14errorStub('test error');15var errorStub = require('stryker-parent').errorStub;16errorStub('test error');17var errorStub = require('stryker-parent').errorStub;18errorStub('test error');19var errorStub = require('stryker-parent').errorStub;20errorStub('test error');21var errorStub = require('stryker-parent').errorStub;22errorStub('test error');23var errorStub = require('stryker-parent').errorStub;24errorStub('test error');25var errorStub = require('stryker-parent').errorStub;26errorStub('test error');

Full Screen

Using AI Code Generation

copy

Full Screen

1var errorStub = require('stryker-parent').errorStub;2var childProcess = require('child_process');3var child = childProcess.spawn('node', ['child.js']);4child.on('error', errorStub('Failed to start child process'));5child.on('exit', function (code) {6 if (code !== 0) {7 throw errorStub('Child process exited with code ' + code);8 }9});10throw new Error('I am a child error');

Full Screen

Using AI Code Generation

copy

Full Screen

1var errorStub = require('stryker-parent').errorStub;2errorStub('Error', 'Error message');3var errorStub = require('stryker-parent').errorStub;4errorStub('Error', 'Error message');5var errorStub = require('stryker-parent').errorStub;6errorStub('Error', 'Error message');7var errorStub = require('stryker-parent').errorStub;8errorStub('Error', 'Error message');9var errorStub = require('stryker-parent').errorStub;10errorStub('Error', 'Error message');11var errorStub = require('stryker-parent').errorStub;12errorStub('Error', 'Error message');13var errorStub = require('stryker-parent').errorStub;14errorStub('Error', 'Error message');15var errorStub = require('stryker-parent').errorStub;16errorStub('Error', 'Error message');17var errorStub = require('stryker-parent').errorStub;18errorStub('Error', 'Error message');19var errorStub = require('stryker-parent').errorStub;20errorStub('Error', 'Error message');21var errorStub = require('stryker-parent').errorStub;22errorStub('Error', 'Error message');23var errorStub = require('stryker-parent').errorStub;24errorStub('Error', 'Error message');25var errorStub = require('stry

Full Screen

Using AI Code Generation

copy

Full Screen

1var errorStub = require('stryker-parent').errorStub;2var fs = require('fs');3errorStub(function() {4 fs.readFile('non-existing-file', 'utf8', function (err, data) {5 if (err) throw err;6 console.log(data);7 });8});9module.exports = function(config) {10 config.set({11 });12};13[2017-07-13 15:47:35.371] [INFO] SandboxPool - Creating 1 test runners (based on CPU count)14[2017-07-13 15:47:35.383] [INFO] Stryker - 1 Mutant(s) generated15[2017-07-13 15:47:35.384] [INFO] SandboxPool - Creating 1 test runners (based on CPU count)

Full Screen

Using AI Code Generation

copy

Full Screen

1var errorStub = require('stryker-parent').errorStub;2var test = require('tape');3test('test', function (t) {4 t.equal(1, 1);5 t.end();6});7test('test2', function (t) {8 t.plan(1);9 t.equal(1, 1);10 errorStub('some error');11});12test('test3', function (t) {13 t.equal(1, 1);14 t.end();15});16test('test4', function (t) {17 t.plan(1);18 t.equal(1, 1);19 errorStub('some error');20});21test('test5', function (t) {22 t.equal(1, 1);23 t.end();24});25test('test6', function (t) {26 t.plan(1);27 t.equal(1, 1);28 errorStub('some error');29});30test('test7', function (t) {31 t.equal(1, 1);32 t.end();33});34test('test8', function (t) {35 t.plan(1);36 t.equal(1, 1);37 errorStub('some error');38});39test('test9', function (t) {40 t.equal(1, 1);41 t.end();42});43test('test10', function (t) {44 t.plan(1);45 t.equal(1, 1);46 errorStub('some error');47});48test('test11', function (t) {49 t.equal(1, 1);50 t.end();51});52test('test12', function (t) {53 t.plan(1);54 t.equal(1, 1);55 errorStub('some error');56});57test('test13', function (t) {58 t.equal(1, 1);59 t.end();60});61test('test14', function (t) {62 t.plan(1);63 t.equal(1, 1);64 errorStub('some error');65});66test('test15', function (t) {67 t.equal(1, 1);68 t.end();69});70test('test16', function (t) {71 t.plan(1);72 t.equal(1, 1);73 errorStub('some error');74});75test('test17', function (t) {76 t.equal(1, 1);77 t.end();78});

Full Screen

Using AI Code Generation

copy

Full Screen

1var errorStub = require('stryker-parent').errorStub;2var error = errorStub('test', 'test.js');3console.log(error);4var errorStub = require('stryker-parent').errorStub;5var error = errorStub('test', 'test.js');6console.log(error);7var errorStub = require('stryker-parent').errorStub;8var error = errorStub('test', 'test.js');9console.log(error);10var errorStub = require('stryker-parent').errorStub;11var error = errorStub('test', 'test.js');12console.log(error);13var errorStub = require('stryker-parent').errorStub;14var error = errorStub('test', 'test.js');15console.log(error);16var errorStub = require('stryker-parent').errorStub;17var error = errorStub('test', 'test.js');18console.log(error);19var errorStub = require('stryker-parent').errorStub;20var error = errorStub('test', 'test.js');21console.log(error);22var errorStub = require('stryker-parent').errorStub;23var error = errorStub('test', 'test.js');24console.log(error);25var errorStub = require('stryker-parent').errorStub;26var error = errorStub('test', 'test.js');27console.log(error);28var errorStub = require('stryker-parent').errorStub;29var error = errorStub('test', 'test.js');30console.log(error);31var errorStub = require('stryker-parent').errorStub;32var error = errorStub('test', 'test.js');33console.log(error);34var errorStub = require('stry

Full Screen

Using AI Code Generation

copy

Full Screen

1var errorStub = require('stryker-parent').errorStub;2var error = errorStub('message', 'code');3console.log(error);4var errorStub = require('stryker-parent').errorStub;5var error = errorStub('message', 'code');6console.log(error);7var errorStub = require('stryker-parent').errorStub;8var error = errorStub('message', 'code');9console.log(error);10var errorStub = require('stryker-parent').errorStub;11var error = errorStub('message', 'code');12console.log(error);13var errorStub = require('stryker-parent').errorStub;14var error = errorStub('message', 'code');15console.log(error);16var errorStub = require('stryker-parent').errorStub;17var error = errorStub('message', 'code');18console.log(error);19var errorStub = require('stryker-parent').errorStub;20var error = errorStub('message', 'code');21console.log(error);22var errorStub = require('stryker-parent').errorStub;23var error = errorStub('message', 'code');24console.log(error);25var errorStub = require('stryker-parent').errorStub;26var error = errorStub('message', 'code');27console.log(error);28var errorStub = require('stryker-parent').errorStub;29var error = errorStub('message', 'code');30console.log(error);31var errorStub = require('stryker-parent').errorStub;32var error = errorStub('message', 'code');33console.log(error);

Full Screen

Automation Testing Tutorials

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.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run stryker-parent automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful