How to use createComponent method in ng-mocks

Best JavaScript code snippet using ng-mocks

mr_widget_ready_to_merge_spec.js

Source:mr_widget_ready_to_merge_spec.js Github

copy

Full Screen

...77 });78 describe('computed', () => {79 describe('isAutoMergeAvailable', () => {80 it('should return true when at least one merge strategy is available', () => {81 createComponent();82 expect(wrapper.vm.isAutoMergeAvailable).toBe(true);83 });84 it('should return false when no merge strategies are available', () => {85 createComponent({ mr: { availableAutoMergeStrategies: [] } });86 expect(wrapper.vm.isAutoMergeAvailable).toBe(false);87 });88 });89 describe('status', () => {90 it('defaults to success', () => {91 createComponent({ mr: { pipeline: true, availableAutoMergeStrategies: [] } });92 expect(wrapper.vm.status).toEqual('success');93 });94 it('returns failed when MR has CI but also has an unknown status', () => {95 createComponent({ mr: { hasCI: true } });96 expect(wrapper.vm.status).toEqual('failed');97 });98 it('returns default when MR has no pipeline', () => {99 createComponent({ mr: { availableAutoMergeStrategies: [] } });100 expect(wrapper.vm.status).toEqual('success');101 });102 it('returns pending when pipeline is active', () => {103 createComponent({ mr: { pipeline: {}, isPipelineActive: true } });104 expect(wrapper.vm.status).toEqual('pending');105 });106 it('returns failed when pipeline is failed', () => {107 createComponent({108 mr: { pipeline: {}, isPipelineFailed: true, availableAutoMergeStrategies: [] },109 });110 expect(wrapper.vm.status).toEqual('failed');111 });112 });113 describe('mergeButtonVariant', () => {114 it('defaults to confirm class', () => {115 createComponent({116 mr: { availableAutoMergeStrategies: [] },117 });118 expect(wrapper.vm.mergeButtonVariant).toEqual('confirm');119 });120 it('returns confirm class for success status', () => {121 createComponent({122 mr: { availableAutoMergeStrategies: [], pipeline: true },123 });124 expect(wrapper.vm.mergeButtonVariant).toEqual('confirm');125 });126 it('returns confirm class for pending status', () => {127 createComponent();128 expect(wrapper.vm.mergeButtonVariant).toEqual('confirm');129 });130 it('returns danger class for failed status', () => {131 createComponent({ mr: { hasCI: true } });132 expect(wrapper.vm.mergeButtonVariant).toEqual('danger');133 });134 });135 describe('status icon', () => {136 it('defaults to tick icon', () => {137 createComponent();138 expect(wrapper.vm.iconClass).toEqual('success');139 });140 it('shows tick for success status', () => {141 createComponent({ mr: { pipeline: true } });142 expect(wrapper.vm.iconClass).toEqual('success');143 });144 it('shows tick for pending status', () => {145 createComponent({ mr: { pipeline: {}, isPipelineActive: true } });146 expect(wrapper.vm.iconClass).toEqual('success');147 });148 });149 describe('mergeButtonText', () => {150 it('should return "Merge" when no auto merge strategies are available', () => {151 createComponent({ mr: { availableAutoMergeStrategies: [] } });152 expect(wrapper.vm.mergeButtonText).toEqual('Merge');153 });154 it('should return "Merge in progress"', async () => {155 createComponent();156 wrapper.setData({ isMergingImmediately: true });157 await Vue.nextTick();158 expect(wrapper.vm.mergeButtonText).toEqual('Merge in progress');159 });160 it('should return "Merge when pipeline succeeds" when the MWPS auto merge strategy is available', () => {161 createComponent({162 mr: { isMergingImmediately: false, preferredAutoMergeStrategy: MWPS_MERGE_STRATEGY },163 });164 expect(wrapper.vm.mergeButtonText).toEqual('Merge when pipeline succeeds');165 });166 });167 describe('autoMergeText', () => {168 it('should return Merge when pipeline succeeds', () => {169 createComponent({ mr: { preferredAutoMergeStrategy: MWPS_MERGE_STRATEGY } });170 expect(wrapper.vm.autoMergeText).toEqual('Merge when pipeline succeeds');171 });172 });173 describe('shouldShowMergeImmediatelyDropdown', () => {174 it('should return false if no pipeline is active', () => {175 createComponent({176 mr: { isPipelineActive: false, onlyAllowMergeIfPipelineSucceeds: false },177 });178 expect(wrapper.vm.shouldShowMergeImmediatelyDropdown).toBe(false);179 });180 it('should return false if "Pipelines must succeed" is enabled for the current project', () => {181 createComponent({ mr: { isPipelineActive: true, onlyAllowMergeIfPipelineSucceeds: true } });182 expect(wrapper.vm.shouldShowMergeImmediatelyDropdown).toBe(false);183 });184 });185 describe('isMergeButtonDisabled', () => {186 it('should return false with initial data', () => {187 createComponent({ mr: { isMergeAllowed: true } });188 expect(wrapper.vm.isMergeButtonDisabled).toBe(false);189 });190 it('should return true when there is no commit message', () => {191 createComponent({ mr: { isMergeAllowed: true, commitMessage: '' } });192 expect(wrapper.vm.isMergeButtonDisabled).toBe(true);193 });194 it('should return true if merge is not allowed', () => {195 createComponent({196 mr: {197 isMergeAllowed: false,198 availableAutoMergeStrategies: [],199 onlyAllowMergeIfPipelineSucceeds: true,200 },201 });202 expect(wrapper.vm.isMergeButtonDisabled).toBe(true);203 });204 it('should return true when the vm instance is making request', async () => {205 createComponent({ mr: { isMergeAllowed: true } });206 wrapper.setData({ isMakingRequest: true });207 await Vue.nextTick();208 expect(wrapper.vm.isMergeButtonDisabled).toBe(true);209 });210 });211 });212 describe('methods', () => {213 describe('handleMergeButtonClick', () => {214 const returnPromise = (status) =>215 new Promise((resolve) => {216 resolve({217 data: {218 status,219 },220 });221 });222 it('should handle merge when pipeline succeeds', (done) => {223 createComponent();224 jest.spyOn(eventHub, '$emit').mockImplementation(() => {});225 jest226 .spyOn(wrapper.vm.service, 'merge')227 .mockReturnValue(returnPromise('merge_when_pipeline_succeeds'));228 wrapper.setData({ removeSourceBranch: false });229 wrapper.vm.handleMergeButtonClick(true);230 setImmediate(() => {231 expect(wrapper.vm.isMakingRequest).toBeTruthy();232 expect(eventHub.$emit).toHaveBeenCalledWith('MRWidgetUpdateRequested');233 expect(eventHub.$emit).toHaveBeenCalledWith('StateMachineValueChanged', {234 transition: 'start-auto-merge',235 });236 const params = wrapper.vm.service.merge.mock.calls[0][0];237 expect(params).toEqual(238 expect.objectContaining({239 sha: wrapper.vm.mr.sha,240 commit_message: wrapper.vm.mr.commitMessage,241 should_remove_source_branch: false,242 auto_merge_strategy: 'merge_when_pipeline_succeeds',243 }),244 );245 done();246 });247 });248 it('should handle merge failed', (done) => {249 createComponent();250 jest.spyOn(eventHub, '$emit').mockImplementation(() => {});251 jest.spyOn(wrapper.vm.service, 'merge').mockReturnValue(returnPromise('failed'));252 wrapper.vm.handleMergeButtonClick(false, true);253 setImmediate(() => {254 expect(wrapper.vm.isMakingRequest).toBeTruthy();255 expect(eventHub.$emit).toHaveBeenCalledWith('FailedToMerge', undefined);256 const params = wrapper.vm.service.merge.mock.calls[0][0];257 expect(params.should_remove_source_branch).toBeTruthy();258 expect(params.auto_merge_strategy).toBeUndefined();259 done();260 });261 });262 it('should handle merge action accepted case', (done) => {263 createComponent();264 jest.spyOn(eventHub, '$emit').mockImplementation(() => {});265 jest.spyOn(wrapper.vm.service, 'merge').mockReturnValue(returnPromise('success'));266 jest.spyOn(wrapper.vm, 'initiateMergePolling').mockImplementation(() => {});267 wrapper.vm.handleMergeButtonClick();268 expect(eventHub.$emit).toHaveBeenCalledWith('StateMachineValueChanged', {269 transition: 'start-merge',270 });271 setImmediate(() => {272 expect(wrapper.vm.isMakingRequest).toBeTruthy();273 expect(wrapper.vm.initiateMergePolling).toHaveBeenCalled();274 const params = wrapper.vm.service.merge.mock.calls[0][0];275 expect(params.should_remove_source_branch).toBeTruthy();276 expect(params.auto_merge_strategy).toBeUndefined();277 done();278 });279 });280 });281 describe('initiateMergePolling', () => {282 it('should call simplePoll', () => {283 createComponent();284 wrapper.vm.initiateMergePolling();285 expect(simplePoll).toHaveBeenCalledWith(expect.any(Function), { timeout: 0 });286 });287 it('should call handleMergePolling', () => {288 createComponent();289 jest.spyOn(wrapper.vm, 'handleMergePolling').mockImplementation(() => {});290 wrapper.vm.initiateMergePolling();291 expect(wrapper.vm.handleMergePolling).toHaveBeenCalled();292 });293 });294 describe('initiateRemoveSourceBranchPolling', () => {295 it('should emit event and call simplePoll', () => {296 createComponent();297 jest.spyOn(eventHub, '$emit').mockImplementation(() => {});298 wrapper.vm.initiateRemoveSourceBranchPolling();299 expect(eventHub.$emit).toHaveBeenCalledWith('SetBranchRemoveFlag', [true]);300 expect(simplePoll).toHaveBeenCalled();301 });302 });303 describe('handleRemoveBranchPolling', () => {304 const returnPromise = (state) =>305 new Promise((resolve) => {306 resolve({307 data: {308 source_branch_exists: state,309 },310 });311 });312 it('should call start and stop polling when MR merged', (done) => {313 createComponent();314 jest.spyOn(eventHub, '$emit').mockImplementation(() => {});315 jest.spyOn(wrapper.vm.service, 'poll').mockReturnValue(returnPromise(false));316 let cpc = false; // continuePollingCalled317 let spc = false; // stopPollingCalled318 wrapper.vm.handleRemoveBranchPolling(319 () => {320 cpc = true;321 },322 () => {323 spc = true;324 },325 );326 setImmediate(() => {327 expect(wrapper.vm.service.poll).toHaveBeenCalled();328 const args = eventHub.$emit.mock.calls[0];329 expect(args[0]).toEqual('MRWidgetUpdateRequested');330 expect(args[1]).toBeDefined();331 args[1]();332 expect(eventHub.$emit).toHaveBeenCalledWith('SetBranchRemoveFlag', [false]);333 expect(cpc).toBeFalsy();334 expect(spc).toBeTruthy();335 done();336 });337 });338 it('should continue polling until MR is merged', (done) => {339 createComponent();340 jest.spyOn(wrapper.vm.service, 'poll').mockReturnValue(returnPromise(true));341 let cpc = false; // continuePollingCalled342 let spc = false; // stopPollingCalled343 wrapper.vm.handleRemoveBranchPolling(344 () => {345 cpc = true;346 },347 () => {348 spc = true;349 },350 );351 setImmediate(() => {352 expect(cpc).toBeTruthy();353 expect(spc).toBeFalsy();354 done();355 });356 });357 });358 });359 describe('Remove source branch checkbox', () => {360 describe('when user can merge but cannot delete branch', () => {361 it('should be disabled in the rendered output', () => {362 createComponent();363 expect(wrapper.find('#remove-source-branch-input').exists()).toBe(false);364 });365 });366 describe('when user can merge and can delete branch', () => {367 beforeEach(() => {368 createComponent({369 mr: { canRemoveSourceBranch: true },370 });371 });372 it('isRemoveSourceBranchButtonDisabled should be false', () => {373 expect(wrapper.find('#remove-source-branch-input').props('disabled')).toBe(undefined);374 });375 });376 });377 describe('render children components', () => {378 const findCheckboxElement = () => wrapper.find(SquashBeforeMerge);379 const findCommitsHeaderElement = () => wrapper.find(CommitsHeader);380 const findCommitEditElements = () => wrapper.findAll(CommitEdit);381 const findCommitDropdownElement = () => wrapper.find(CommitMessageDropdown);382 const findFirstCommitEditLabel = () => findCommitEditElements().at(0).props('label');383 const findTipLink = () => wrapper.find(GlSprintf);384 describe('squash checkbox', () => {385 it('should be rendered when squash before merge is enabled and there is more than 1 commit', () => {386 createComponent({387 mr: { commitsCount: 2, enableSquashBeforeMerge: true },388 });389 expect(findCheckboxElement().exists()).toBeTruthy();390 });391 it('should not be rendered when squash before merge is disabled', () => {392 createComponent({ mr: { commitsCount: 2, enableSquashBeforeMerge: false } });393 expect(findCheckboxElement().exists()).toBeFalsy();394 });395 it('should be rendered when there is only 1 commit', () => {396 createComponent({ mr: { commitsCount: 1, enableSquashBeforeMerge: true } });397 expect(findCheckboxElement().exists()).toBe(true);398 });399 describe('squash options', () => {400 it.each`401 squashState | state | prop | expectation402 ${'squashIsReadonly'} | ${'enabled'} | ${'isDisabled'} | ${false}403 ${'squashIsSelected'} | ${'selected'} | ${'value'} | ${false}404 ${'squashIsSelected'} | ${'unselected'} | ${'value'} | ${false}405 `(406 'is $state when squashIsReadonly returns $expectation ',407 ({ squashState, prop, expectation }) => {408 createComponent({409 mr: { commitsCount: 2, enableSquashBeforeMerge: true, [squashState]: expectation },410 });411 expect(findCheckboxElement().props(prop)).toBe(expectation);412 },413 );414 it('is not rendered for "Do not allow" option', () => {415 createComponent({416 mr: {417 commitsCount: 2,418 enableSquashBeforeMerge: true,419 squashIsReadonly: true,420 squashIsSelected: false,421 },422 });423 expect(findCheckboxElement().exists()).toBe(false);424 });425 });426 });427 describe('commits count collapsible header', () => {428 it('should be rendered when fast-forward is disabled', () => {429 createComponent();430 expect(findCommitsHeaderElement().exists()).toBeTruthy();431 });432 describe('when fast-forward is enabled', () => {433 it('should be rendered if squash and squash before are enabled and there is more than 1 commit', () => {434 createComponent({435 mr: {436 ffOnlyEnabled: true,437 enableSquashBeforeMerge: true,438 squashIsSelected: true,439 commitsCount: 2,440 },441 });442 expect(findCommitsHeaderElement().exists()).toBeTruthy();443 });444 it('should not be rendered if squash before merge is disabled', () => {445 createComponent({446 mr: {447 ffOnlyEnabled: true,448 enableSquashBeforeMerge: false,449 squash: true,450 commitsCount: 2,451 },452 });453 expect(findCommitsHeaderElement().exists()).toBeFalsy();454 });455 it('should not be rendered if squash is disabled', () => {456 createComponent({457 mr: {458 ffOnlyEnabled: true,459 squash: false,460 enableSquashBeforeMerge: true,461 commitsCount: 2,462 },463 });464 expect(findCommitsHeaderElement().exists()).toBeFalsy();465 });466 it('should not be rendered if commits count is 1', () => {467 createComponent({468 mr: {469 ffOnlyEnabled: true,470 squash: true,471 enableSquashBeforeMerge: true,472 commitsCount: 1,473 },474 });475 expect(findCommitsHeaderElement().exists()).toBeFalsy();476 });477 });478 });479 describe('commits edit components', () => {480 describe('when fast-forward merge is enabled', () => {481 it('should not be rendered if squash is disabled', () => {482 createComponent({483 mr: {484 ffOnlyEnabled: true,485 squash: false,486 enableSquashBeforeMerge: true,487 commitsCount: 2,488 },489 });490 expect(findCommitEditElements().length).toBe(0);491 });492 it('should not be rendered if squash before merge is disabled', () => {493 createComponent({494 mr: {495 ffOnlyEnabled: true,496 squash: true,497 enableSquashBeforeMerge: false,498 commitsCount: 2,499 },500 });501 expect(findCommitEditElements().length).toBe(0);502 });503 it('should not be rendered if there is only one commit', () => {504 createComponent({505 mr: {506 ffOnlyEnabled: true,507 squash: true,508 enableSquashBeforeMerge: true,509 commitsCount: 1,510 },511 });512 expect(findCommitEditElements().length).toBe(0);513 });514 it('should have one edit component if squash is enabled and there is more than 1 commit', () => {515 createComponent({516 mr: {517 ffOnlyEnabled: true,518 squashIsSelected: true,519 enableSquashBeforeMerge: true,520 commitsCount: 2,521 },522 });523 expect(findCommitEditElements().length).toBe(1);524 expect(findFirstCommitEditLabel()).toBe('Squash commit message');525 });526 });527 it('should have one edit component when squash is disabled', () => {528 createComponent();529 expect(findCommitEditElements().length).toBe(1);530 });531 it('should have two edit components when squash is enabled and there is more than 1 commit', () => {532 createComponent({533 mr: {534 commitsCount: 2,535 squashIsSelected: true,536 enableSquashBeforeMerge: true,537 },538 });539 expect(findCommitEditElements().length).toBe(2);540 });541 it('should have two edit components when squash is enabled and there is more than 1 commit and mergeRequestWidgetGraphql is enabled', async () => {542 createComponent(543 {544 mr: {545 commitsCount: 2,546 squashIsSelected: true,547 enableSquashBeforeMerge: true,548 },549 },550 true,551 );552 wrapper.setData({553 loading: false,554 state: {555 ...createTestMr({}),556 userPermissions: {},557 squash: true,558 mergeable: true,559 commitCount: 2,560 commitsWithoutMergeCommits: {},561 },562 });563 await wrapper.vm.$nextTick();564 expect(findCommitEditElements().length).toBe(2);565 });566 it('should have one edit components when squash is enabled and there is 1 commit only', () => {567 createComponent({568 mr: {569 commitsCount: 1,570 squash: true,571 enableSquashBeforeMerge: true,572 },573 });574 expect(findCommitEditElements().length).toBe(1);575 });576 it('should have correct edit merge commit label', () => {577 createComponent();578 expect(findFirstCommitEditLabel()).toBe('Merge commit message');579 });580 it('should have correct edit squash commit label', () => {581 createComponent({582 mr: {583 commitsCount: 2,584 squashIsSelected: true,585 enableSquashBeforeMerge: true,586 },587 });588 expect(findFirstCommitEditLabel()).toBe('Squash commit message');589 });590 });591 describe('commits dropdown', () => {592 it('should not be rendered if squash is disabled', () => {593 createComponent();594 expect(findCommitDropdownElement().exists()).toBeFalsy();595 });596 it('should be rendered if squash is enabled and there is more than 1 commit', () => {597 createComponent({598 mr: { enableSquashBeforeMerge: true, squashIsSelected: true, commitsCount: 2 },599 });600 expect(findCommitDropdownElement().exists()).toBeTruthy();601 });602 });603 it('renders a tip including a link to docs on templates', () => {604 createComponent();605 expect(findTipLink().exists()).toBe(true);606 });607 });608 describe('Merge request project settings', () => {609 describe('when the merge commit merge method is enabled', () => {610 beforeEach(() => {611 createComponent({612 mr: { ffOnlyEnabled: false },613 });614 });615 it('should not show fast forward message', () => {616 expect(wrapper.find('.mr-fast-forward-message').exists()).toBe(false);617 });618 });619 describe('when the fast-forward merge method is enabled', () => {620 beforeEach(() => {621 createComponent({622 mr: { ffOnlyEnabled: true },623 });624 });625 it('should show fast forward message', () => {626 expect(wrapper.find('.mr-fast-forward-message').exists()).toBe(true);627 });628 });629 });...

Full Screen

Full Screen

_ARRANGER.js

Source:_ARRANGER.js Github

copy

Full Screen

...28//-------------------------------------------------------------------------------------------29// TESTING //30proto.test = function() {31 var filters = [];32 filters.push( orchestrator.createComponent('flocking') );33 filters.push( orchestrator.createComponent('chimeCluster') );34 return filters;35};36// BASIC //37proto.basic = function() {38 var filters = [];39 var count, i;40 var reverbAllowed = true;41 var more = tombola.percent(10);42 //------------- SETUP DECKS -------------//43 // BED SETUP //44 var bedItems = ['flocking','cluster','voice','noise','rumble','subHowl','howl','fm','phaseSine'];45 var bedOptions = {46 weights:[1.5, 1, 2, 2, 1, 2, 2, 1, 1],47 instances:[1, 2, 1, 1, 1, 2, 3, 1, 1]48 };49 var bedDeck = tombola.weightedDeck(bedItems,bedOptions);50 // GENERATOR SETUP //51 var generatorItems = ['chimeCluster','chime','fuzzBurst','purr','pattern','growl','siren','pulse','noisePulse','beep','click','sub','wail','burst','ramp','fm','sweep','sweepII'];52 var generatorOptions = {53 weights:[1.5, 2, 1.5, 1.8, 2, 1.7, 2, 0.8, 2, 1.3, 1.5, 1, 1.4, 1.5, 1.2, 1, 1.5, 1.5],54 instances:[1, 2, 2, 1, 2, 1, 2, 1, 2, 1, 1, 1, 2, 2, 2, 1, 1, 1]55 };56 var generatorDeck = tombola.weightedDeck(generatorItems,generatorOptions);57 // EFFECT SETUP //58 var effectItems = ['saturation','chopper','foldBack','foldBackII','invert','panner','shear','bitCrush',tombola.weightedItem(['phaser','chorus'],[3,1])];59 var effectOptions = {60 weights:[1, 2.2, 2, 1.6, 0.5, 0.5, 0.5, 1, 2.5],61 instances:[1, 1, 1, 1, 1, 1, 1, 1, 1]62 };63 var effectDeck = tombola.weightedDeck(effectItems,effectOptions);64 //------------- DRAW ITEMS -------------//65 // BED //66 count = tombola.range(2,3);67 if (more) {68 count = tombola.range(3,4);69 }70 for (i=0; i<count; i++) {71 filters.push( orchestrator.createComponent(bedDeck.draw()) );72 }73 // MAIN //74 count = tombola.range(5,9);75 if (more) {76 count = tombola.range(7,11);77 }78 for (i=0; i<count; i++) {79 if (tombola.percent(70)) {80 filters.push( orchestrator.createComponent(generatorDeck.draw()) );81 }82 else {83 var effect = effectDeck.draw();84 filters.push( orchestrator.createComponent(effect) );85 if (effect==='phaser'||effect==='chorus') {86 reverbAllowed = false;87 }88 }89 }90 // LAST //91 if (reverbAllowed && tombola.percent(40)) {92 filters.push( orchestrator.createComponent('reverb') );93 }94 filters.push( orchestrator.createComponent('clipping') );95 if (tombola.percent(12)) {96 console.log('faster filter');97 filters.push( orchestrator.createComponent('lowPass',[],[orchestrator.createModType('movement','medium')]) );98 } else {99 filters.push( orchestrator.createComponent('lowPass') );100 }101 filters.push( orchestrator.createComponent('static') );102 // POST FILTER //103 if (reverbAllowed && tombola.percent(4)) {104 filters.push( orchestrator.createComponent('reverseDelay') );105 } else {106 if (tombola.percent(40)) {107 filters.push( orchestrator.createComponent('resampler') );108 }109 }110 return filters;111};112// AMBIENT //113proto.ambient = function() {114 var filters = [];115 var count, i;116 var reverbAllowed = true;117 //------------- SETUP DECKS -------------//118 // BED SETUP //119 var bedItems = ['flocking','cluster','voice','noise','rumble','subHowl','howl'];120 var bedOptions = {121 weights:[2, 1, 1, 1, 1.5, 2, 2],122 instances:[2, 2, 1, 1, 1, 2, 3]123 };124 var bedDeck = tombola.weightedDeck(bedItems,bedOptions);125 // GENERATOR SETUP //126 var generatorItems = ['chime','fuzzBurst','flocking','howl','purr','pattern','growl','siren','pulse','noisePulse','beep','click','sub', 'wail','burst','ramp','fm','sweep','sweepII','phaseSine'];127 var generatorOptions = {128 weights:[1.5, 1, 1, 1, 1.5, 1.5, 1.5, 1.5, 0.8, 1.2, 1.2, 1.5, 0.8, 1.5, 1.5, 1.2, 1, 0.8, 1.2, 1.5],129 instances:[2, 1, 1, 1, 2, 2, 2, 2, 1, 2, 1, 2, 1, 2, 2, 2, 1, 1, 1, 2]130 };131 var generatorDeck = tombola.weightedDeck(generatorItems,generatorOptions);132 // EFFECT SETUP //133 var effectItems = ['saturation','chopper','foldBack','foldBackII','panner',tombola.weightedItem(['phaser','chorus'],[3,1])];134 var effectOptions = {135 weights:[0.8, 2, 0.5, 0.5, 0.5, 2],136 instances:[1, 1, 1, 1, 1, 1]137 };138 var effectDeck = tombola.weightedDeck(effectItems,effectOptions);139 //------------- DRAW ITEMS -------------//140 // BED //141 count = tombola.range(1,2);142 for (i=0; i<count; i++) {143 filters.push( orchestrator.createComponent(bedDeck.draw()) );144 }145 // MAIN //146 count = tombola.range(4,7);147 for (i=0; i<count; i++) {148 if (tombola.percent(92)) {149 filters.push( orchestrator.createComponent(generatorDeck.draw()) );150 }151 else {152 var effect = effectDeck.draw();153 filters.push( orchestrator.createComponent(effect) );154 if (effect==='phaser'||effect==='chorus') {155 reverbAllowed = false;156 }157 }158 }159 // LAST //160 if (reverbAllowed && tombola.percent(80)) {161 filters.push( orchestrator.createComponent('reverb') );162 }163 filters.push( orchestrator.createComponent('clipping') );164 filters.push( orchestrator.createComponent('lowPass') );165 filters.push( orchestrator.createComponent('static') );166 // POST FILTER //167 if (reverbAllowed && tombola.percent(3)) {168 filters.push( orchestrator.createComponent('reverseDelay') );169 } else {170 if (tombola.percent(20)) {171 filters.push( orchestrator.createComponent('resampler',[tombola.range(0,6),tombola.range(250000,350000)]) );172 }173 }174 return filters;175};176// CLASSIC //177//(ie the more rigid style I first got used to in testing...)178proto.classic = function() {179 var filters = [];180 var count, i;181 var reverbAllowed = true;182 //------------- SETUP DECKS -------------//183 // BED SETUP //184 var bedItems = ['flocking','cluster','rumble','subHowl','howl'];185 var bedOptions = {186 weights:[2, 1, 1.5, 2, 2],187 instances:[2, 2, 1, 2, 3]188 };189 var bedDeck = tombola.weightedDeck(bedItems,bedOptions);190 // GENERATOR SETUP //191 var generatorItems = ['chimeCluster','chime','fuzzBurst','metallic','flocking','howl','purr','pattern','growl','siren','pulse','noisePulse','beep','click','sub', 'wail','burst','ramp','fm','sweep','sweepII','phaseSine'];192 var generatorOptions = {193 weights:[1, 1, 1.1, 0.5, 1, 1, 1.5, 1.5, 1.5, 1.5, 0.7, 1.2, 1.2, 1.5, 0.8, 1.5, 1.5, 1.2, 1, 0.8, 1.2, 1.5],194 instances:[1, 2, 1, 1, 1, 1, 2, 2, 2, 2, 1, 2, 1, 2, 1, 2, 2, 2, 1, 1, 1, 2]195 };196 var generatorDeck = tombola.weightedDeck(generatorItems,generatorOptions);197 //------------- DRAW ITEMS -------------//198 // BED //199 if (tombola.percent(60)) {200 // VOICE //201 filters.push( orchestrator.createComponent('voice') );202 // RUMBLE //203 if (tombola.percent(30)) {204 filters.push( orchestrator.createComponent('rumble') );205 }206 } else {207 count = tombola.range(1,2);208 for (i=0; i<count; i++) {209 filters.push( orchestrator.createComponent(bedDeck.draw()) );210 }211 }212 // BITCRUSH //213 if (tombola.percent(35)) {214 filters.push( orchestrator.createComponent('bitCrush') );215 }216 // NOISE //217 var noiseArgs = [0];218 if (tombola.percent(50)) {219 noiseArgs = [tombola.range(10000,30000)];220 }221 filters.push( orchestrator.createComponent('noise',noiseArgs) );222 // MAIN //223 count = tombola.range(4,7);224 for (i=0; i<count; i++) {225 filters.push( orchestrator.createComponent(generatorDeck.draw()) );226 }227 // PHASE //228 if (tombola.percent(30)) {229 filters.push( orchestrator.createComponent('phaser',[tombola.rangeFloat(0.25,0.55),{mod:0, min:10, max:4000}],[orchestrator.createMod('fudgeChance',[5,0.05,600])]) );230 reverbAllowed = false;231 } else {232 if (tombola.percent(30)) {233 filters.push( orchestrator.createComponent('phaser',[tombola.rangeFloat(0.05,0.6),{mod:0, min:tombola.rangeFloat(10,400), max:tombola.rangeFloat(3000,3200)}],[orchestrator.createMod('LFO',[tombola.rangeFloat(1,1.4)])]) );234 reverbAllowed = false;235 }236 }237 // FOLDBACK //238 if (tombola.percent(28)) {239 filters.push( orchestrator.createComponent('foldBack') );240 }241 // CHOPPER //242 if (tombola.percent(80)) {243 filters.push( orchestrator.createComponent('chopper',[],[orchestrator.createMod('walk',[1,20000]), orchestrator.createMod('walkSmooth',[3,100])]) );244 }245 // REVERB //246 if (reverbAllowed && tombola.percent(40)) {247 filters.push( orchestrator.createComponent('reverb') );248 }249 // CLIPPING //250 filters.push( orchestrator.createComponent('clipping') );251 // RESAMPLER //252 filters.push( orchestrator.createComponent('resampler',[tombola.item([1,3]),200000]) );253 // LOW PASS //254 if (tombola.percent(20)) {255 filters.push( orchestrator.createComponent('lowPass',[],[orchestrator.createModType('movement','medium')]) );256 } else {257 filters.push( orchestrator.createComponent('lowPass',[{mod: 0, min: 400, max: 9000},0.92],[orchestrator.createMod('walk',[0.2,30000])]) );258 }259 // STATIC //260 filters.push( orchestrator.createComponent('static') );261 return filters;262};...

Full Screen

Full Screen

create.controller.spec.js

Source:create.controller.spec.js Github

copy

Full Screen

1'use strict';2describe('Component:DispositionCreateComponent', function () {3 // load the controller's module4 beforeEach(module('fakiyaMainApp'));5 var CreateComponent, scope, httpBackend;6 var state, dispositionsService, endPointUrl;7 // Initialize the controller and a mock scope8 beforeEach(inject(function ($componentController, $rootScope, $httpBackend, $state, $stateParams, _DispositionsService_, appConfig) {9 scope = $rootScope.$new();10 httpBackend = $httpBackend;11 state = $state;12 dispositionsService = _DispositionsService_;13 if (appConfig.apiUri) {14 endPointUrl = appConfig.apiUri + '/f9/admin/dispositions';15 }16 CreateComponent = $componentController('al.dispositions.create', {17 $scope: scope,18 $stateParams: { message: null },19 $state: state,20 DispositionsService: dispositionsService,21 redial: {useTimer: false, validAttempts: true, timer: {minutes: 1, days: 0, hours: 0}, allowChangeTimer: false},22 notDial: {useTimer: false, timer: {minutes: 1, days: 0, hours: 0}, allowChangeTimer: false}23 });24 httpBackend.whenGET(url => (url.indexOf('.html') !== -1)).respond(200);25 httpBackend.whenPOST(appConfig.apiUri+'/f9/admin/lists').respond(200);26 }));27 describe('#timeField', () => {28 it('if Hours and Days are equal to zero, min of minutes should be one', function () {29 CreateComponent.redial.timer={minutes: 1, days: 0, hours: 0};30 expect(CreateComponent.minOfMinutes(CreateComponent.redial.timer)).to.equal(1);31 });32 it('if Hours or Days are diferent to zero, min of minutes should be zero', function () {33 CreateComponent.redial.timer={minutes: 1, days: 1, hours: 0};34 expect(CreateComponent.minOfMinutes(CreateComponent.redial.timer)).to.equal(0);35 CreateComponent.redial.timer={minutes: 1, days: 0, hours: 1};36 expect(CreateComponent.minOfMinutes(CreateComponent.redial.timer)).to.equal(0);37 CreateComponent.redial.timer={minutes: 1, days: 1, hours: 1};38 expect(CreateComponent.minOfMinutes(CreateComponent.redial.timer)).to.equal(0);39 });40 it('if Minutes and Days are equal to zero, min of hours should be one', function () {41 CreateComponent.redial.timer={minutes: 0, days: 0, hours: 1};42 expect(CreateComponent.minOfHours(CreateComponent.redial.timer)).to.equal(1);43 });44 it('if Minutes or Days are diferent to zero, min of hours should be zero', function () {45 CreateComponent.redial.timer={minutes: 0, days: 1, hours: 1};46 expect(CreateComponent.minOfHours(CreateComponent.redial.timer)).to.equal(0);47 CreateComponent.redial.timer={minutes: 1, days: 0, hours: 1};48 expect(CreateComponent.minOfHours(CreateComponent.redial.timer)).to.equal(0);49 CreateComponent.redial.timer={minutes: 1, days: 1, hours: 1};50 expect(CreateComponent.minOfHours(CreateComponent.redial.timer)).to.equal(0);51 });52 it('if Minutes and Hours are equal to zero, min of days should be one', function () {53 CreateComponent.redial.timer={minutes: 0, days: 1, hours: 0};54 expect(CreateComponent.minOfDays(CreateComponent.redial.timer)).to.equal(1);55 });56 it('if Minutes or Hours are diferent to zero, min of days should be zero', function () {57 CreateComponent.redial.timer={minutes: 0, days: 1, hours: 1};58 expect(CreateComponent.minOfDays(CreateComponent.redial.timer)).to.equal(0);59 CreateComponent.redial.timer={minutes: 1, days: 1, hours: 0};60 expect(CreateComponent.minOfDays(CreateComponent.redial.timer)).to.equal(0);61 CreateComponent.redial.timer={minutes: 1, days: 1, hours: 1};62 expect(CreateComponent.minOfDays(CreateComponent.redial.timer)).to.equal(0);63 });64 });65 describe('#save', () => {66 it('=> should return Status 201, created OK"', () => {67 httpBackend.whenPOST(endPointUrl).respond(201,null);68 let saveDisposition=CreateComponent.save();69 expect(CreateComponent.SubmitText).to.equal('Saving...');70 saveDisposition71 .then(response=>{72 expect(response.statusCode).to.equal(201);73 expect(response.data).to.equal(null);74 expect(response.errorMessage).to.equal(null);75 expect(CreateComponent.message.text).to.equal('Disposition Created Successfully');76 });77 httpBackend.flush();78 });79 it('=> should return Status 500, created error', () => {80 httpBackend.whenPOST(endPointUrl).respond(500,{81 error: 'Error message'82 });83 CreateComponent.save()84 .then(response=>{85 expect(response.statusCode).to.equal(500);86 expect(response.data).to.equal(null);87 expect(response.errorMessage).to.not.equal(null);88 expect(CreateComponent.SubmitText).to.equal('Save');89 expect(CreateComponent.message.text).to.equal('Error message');90 });91 httpBackend.flush();92 });93 });...

Full Screen

Full Screen

output.js

Source:output.js Github

copy

Full Screen

...18const template11 = _$ssr(19 _tmpl$,20 state.a ? _$escape(a()) : state.b ? _$escape(b()) : state.c ? "c" : "fallback"21);22const template12 = _$createComponent(Comp, {23 get render() {24 return state.dynamic ? good() : bad;25 }26}); // no dynamic predicate27const template13 = _$createComponent(Comp, {28 get render() {29 return state.dynamic ? good : bad;30 }31});32const template14 = _$createComponent(Comp, {33 get render() {34 return state.dynamic && good();35 }36}); // no dynamic predicate37const template15 = _$createComponent(Comp, {38 get render() {39 return state.dynamic && good;40 }41});42const template16 = _$createComponent(Comp, {43 get render() {44 return state.dynamic || good();45 }46});47const template17 = _$createComponent(Comp, {48 get render() {49 return state.dynamic ? _$createComponent(Comp, {}) : _$createComponent(Comp, {});50 }51});52const template18 = _$createComponent(Comp, {53 get children() {54 return state.dynamic ? _$createComponent(Comp, {}) : _$createComponent(Comp, {});55 }56});57const template19 = _$ssr(58 _tmpl$,59 state.dynamic ? _$createComponent(Comp, {}) : _$createComponent(Comp, {})60);61const template20 = _$ssr(62 _tmpl$,63 state.dynamic ? _$escape(_$createComponent(Comp, {})) : _$escape(_$createComponent(Comp, {}))64);65const template21 = _$createComponent(Comp, {66 get render() {67 return state?.dynamic ? "a" : "b";68 }69});70const template22 = _$createComponent(Comp, {71 get children() {72 return state?.dynamic ? "a" : "b";73 }74});75const template23 = _$ssr(_tmpl$, state?.dynamic ? "a" : "b");76const template24 = _$ssr(_tmpl$, state?.dynamic ? "a" : "b");77const template25 = _$createComponent(Comp, {78 get render() {79 return state.dynamic ?? _$createComponent(Comp, {});80 }81});82const template26 = _$createComponent(Comp, {83 get children() {84 return state.dynamic ?? _$createComponent(Comp, {});85 }86});87const template27 = _$ssr(_tmpl$, state.dynamic ?? _$createComponent(Comp, {}));88const template28 = _$ssr(_tmpl$, _$escape(state.dynamic) ?? _$escape(_$createComponent(Comp, {})));89const template29 = _$ssr(90 _tmpl$,91 (thing() && _$escape(thing1())) ?? _$escape(thing2()) ?? _$escape(thing3())92);...

Full Screen

Full Screen

index.js

Source:index.js Github

copy

Full Screen

...10 <i {...rest} className={classes}></i>11 )12}1314const Loading = createComponent('loading')15const Ellipsis = createComponent('ellipsis')16const Search = createComponent('search')17const Play = createComponent('play')18const Pause = createComponent('pause')19const Next = createComponent('next')20const Prev = createComponent('prev')21const ArrowLeft = createComponent('arrow-left')22const ArrowRight = createComponent('arrow-right')23const ArrowDown = createComponent('arrow-down')24const ArrowUp = createComponent('arrow-up')25const Clock = createComponent('clock')26const Close = createComponent('close')27const HeadPhone = createComponent('headphone')28const PlayMenu = createComponent('play-menu')29const Retweet = createComponent('retweet')30const RetweetBlack = createComponent('retweet-black')31const Random = createComponent('random')32const RandomBlack = createComponent('random-black')33const LoopOne = createComponent('loop-one')34const LoopOneBlack = createComponent('loop-one-black')35const Trash = createComponent('trash')3637class Icon extends PureComponent {38 static defaultProps = {39 classPrefixer:'icon'40 }41 constructor(props){42 super(props)43 this.state = {44 loading:(<Loading {...props} />),45 ellipsis:(<Ellipsis {...props} />),46 search:(<Search {...props} />),47 play:(<Play {...props} />),48 pause:(<Pause {...props} />),49 next:(<Next {...props} />), ...

Full Screen

Full Screen

svgMock.ts

Source:svgMock.ts Github

copy

Full Screen

...11 }12}13// Mock all react-native-svg exports14// from https://github.com/magicismight/react-native-svg/blob/master/index.js15const Svg = createComponent('Svg')16const Circle = createComponent('Circle')17const Ellipse = createComponent('Ellipse')18const G = createComponent('G')19const Text = createComponent('Text')20const TextPath = createComponent('TextPath')21const TSpan = createComponent('TSpan')22const Path = createComponent('Path')23const Polygon = createComponent('Polygon')24const Polyline = createComponent('Polyline')25const Line = createComponent('Line')26const Rect = createComponent('Rect')27const Use = createComponent('Use')28const Image = createComponent('Image')29const Symbol = createComponent('Symbol')30const Defs = createComponent('Defs')31const LinearGradient = createComponent('LinearGradient')32const RadialGradient = createComponent('RadialGradient')33const Stop = createComponent('Stop')34const ClipPath = createComponent('ClipPath')35const Pattern = createComponent('Pattern')36const Mask = createComponent('Mask')37export {38 Circle,39 ClipPath,40 Defs,41 Ellipse,42 G,43 Image,44 Line,45 LinearGradient,46 Mask,47 Path,48 Pattern,49 Polygon,50 Polyline,...

Full Screen

Full Screen

react-native-svg.js

Source:react-native-svg.js Github

copy

Full Screen

...9 };10};11// Mock all react-native-svg exports12// from https://github.com/magicismight/react-native-svg/blob/master/index.js13const Svg = createComponent('Svg');14const Circle = createComponent('Circle');15const Ellipse = createComponent('Ellipse');16const G = createComponent('G');17const Text = createComponent('Text');18const TextPath = createComponent('TextPath');19const TSpan = createComponent('TSpan');20const Path = createComponent('Path');21const Polygon = createComponent('Polygon');22const Polyline = createComponent('Polyline');23const Line = createComponent('Line');24const Rect = createComponent('Rect');25const Use = createComponent('Use');26const Image = createComponent('Image');27const Symbol = createComponent('Symbol');28const Defs = createComponent('Defs');29const LinearGradient = createComponent('LinearGradient');30const RadialGradient = createComponent('RadialGradient');31const Stop = createComponent('Stop');32const ClipPath = createComponent('ClipPath');33const Pattern = createComponent('Pattern');34const Mask = createComponent('Mask');35export {36 Svg,37 Circle,38 Ellipse,39 G,40 Text,41 TextPath,42 TSpan,43 Path,44 Polygon,45 Polyline,46 Line,47 Rect,48 Use,...

Full Screen

Full Screen

Using AI Code Generation

copy

Full Screen

1import { createComponent } from 'ng-mocks';2import { AppComponent } from './app.component';3describe('AppComponent', () => {4 it('should create the app', () => {5 const fixture = createComponent(AppComponent);6 const app = fixture.debugElement.componentInstance;7 expect(app).toBeTruthy();8 });9});10import { Component } from '@angular/core';11@Component({12})13export class AppComponent {14 title = 'my-app';15}16 {{ title }}17h1 {18 color: red;19}20import { TestBed, async } from '@angular/core/testing';21import { AppComponent } from './app.component';22describe('AppComponent', () => {23 beforeEach(async(() => {24 TestBed.configureTestingModule({25 }).compileComponents();26 }));27 it('should create the app', () => {28 const fixture = TestBed.createComponent(AppComponent);29 const app = fixture.debugElement.componentInstance;30 expect(app).toBeTruthy();31 });32});33import { createComponent } from 'ng-mocks';34import { AppComponent } from './app.component';35describe('AppComponent', () => {36 it('should create the app', () => {37 const fixture = createComponent(AppComponent);38 const app = fixture.debugElement.componentInstance;39 expect(app).toBeTruthy();40 });41});42import { Component } from '@angular/core';43@Component({44})45export class AppComponent {46 title = 'my-app';47}48 {{ title }}49h1 {50 color: red;51}52import { TestBed, async } from '@angular/core/testing';53import { AppComponent } from './app.component';54describe('AppComponent', () => {55 beforeEach(async(() => {56 TestBed.configureTestingModule({57 }).compileComponents();58 }));59 it('should create the app', () => {60 const fixture = TestBed.createComponent(AppComponent);

Full Screen

Using AI Code Generation

copy

Full Screen

1import { createComponent } from 'ng-mocks';2import { AppComponent } from './app.component';3describe('AppComponent', () => {4 it('should create the app', () => {5 const fixture = createComponent(AppComponent);6 const app = fixture.componentInstance;7 expect(app).toBeTruthy();8 });9});

Full Screen

Using AI Code Generation

copy

Full Screen

1import { createComponent } from 'ng-mocks';2import { AppComponent } from './app.component';3describe('AppComponent', () => {4 it('should create the app', () => {5 const fixture = createComponent(AppComponent);6 const app = fixture.debugElement.componentInstance;7 expect(app).toBeTruthy();8 });9});10import { createComponent } from 'ng-mocks';11import { AppComponent } from './app.component';12describe('AppComponent', () => {13 it('should create the app', () => {14 const fixture = createComponent(AppComponent);15 const app = fixture.debugElement.componentInstance;16 expect(app).toBeTruthy();17 });18});19import { createComponent } from 'ng-mocks';20import { AppComponent } from './app.component';21describe('AppComponent', () => {22 it('should create the app', () => {23 const fixture = createComponent(AppComponent);24 const app = fixture.debugElement.componentInstance;25 expect(app).toBeTruthy();26 });27});28import { createComponent } from 'ng-mocks';29import { AppComponent } from './app.component';30describe('AppComponent', () => {31 it('should create the app', () => {32 const fixture = createComponent(AppComponent);33 const app = fixture.debugElement.componentInstance;34 expect(app).toBeTruthy();35 });36});37import { createComponent } from 'ng-mocks';38import { AppComponent } from './app.component';39describe('AppComponent', () => {40 it('should create the app', () => {41 const fixture = createComponent(AppComponent);42 const app = fixture.debugElement.componentInstance;43 expect(app).toBeTruthy();44 });45});46import { createComponent } from 'ng-mocks';47import { AppComponent } from './app.component';48describe('AppComponent', () => {49 it('should create the app', () => {50 const fixture = createComponent(AppComponent);51 const app = fixture.debugElement.componentInstance;52 expect(app).toBeTruthy();53 });54});

Full Screen

Using AI Code Generation

copy

Full Screen

1import { createComponent } from 'ng-mocks';2import { AppComponent } from './app.component';3describe('AppComponent', () => {4 it('should create the app', () => {5 const fixture = createComponent(AppComponent);6 const app = fixture.debugElement.componentInstance;7 expect(app).toBeTruthy();8 });9});

Full Screen

Using AI Code Generation

copy

Full Screen

1import { createComponent } from 'ng-mocks';2import { TestComponent } from './test.component';3describe('TestComponent', () => {4 it('should create', () => {5 const fixture = createComponent(TestComponent);6 expect(fixture).toBeTruthy();7 });8});9import { Component } from '@angular/core';10@Component({11})12export class TestComponent {13 constructor() { }14}15h1 {16 color: red;17}18import { createComponent } from 'ng-mocks';19import { TestComponent } from './test.component';20describe('TestComponent', () => {21 it('should create', () => {22 const fixture = createComponent(TestComponent);23 expect(fixture).toBeTruthy();24 });25});26import { Component } from '@angular/core';27@Component({28})29export class TestComponent {30 constructor() { }31}32h1 {33 color: red;34}35import { createComponent } from 'ng-mocks';36import { TestComponent } from './test.component';37describe('TestComponent', () => {38 it('should create', () => {39 const fixture = createComponent(TestComponent);40 expect(fixture).toBeTruthy();41 });42});43import { Component } from '@angular/core';44@Component({45})46export class TestComponent {47 constructor() { }48}49h1 {50 color: red;51}52import { createComponent } from 'ng-mocks';53import { TestComponent } from './test

Full Screen

Using AI Code Generation

copy

Full Screen

1import { createComponent } from 'ng-mocks';2import { Component } from '@angular/core';3import { MyComponent } from './my.component';4describe('MyComponent', () => {5 it('should be defined', () => {6 const fixture = createComponent(MyComponent);7 expect(fixture).toBeDefined();8 });9});10import { Component } from '@angular/core';11@Component({12})13export class MyComponent {}14detectChanges(): Detects changes in the component and its children15destroy(): Destroys the component instance16whenStable(): Returns a promise that resolves when the component is stable17import { createComponent } from 'ng-mocks';18import { Component } from '@angular/core';19import { MyComponent } from './my.component';20describe('MyComponent', () => {21 it('should be defined', () => {22 const fixture = createComponent(MyComponent);23 expect(fixture.componentInstance).toBeDefined();24 });25});26import { createComponent } from 'ng-mocks';27import { Component } from '@angular/core';28import { MyComponent } from './my.component';29describe('MyComponent', () => {30 it('should be defined', ()

Full Screen

Using AI Code Generation

copy

Full Screen

1import { createComponent } from 'ng-mocks';2import { AppComponent } from './app.component';3const component = createComponent(AppComponent);4console.log(component);5import { createComponent } from 'ng-mocks';6import { AppComponent } from './app.component';7describe('AppComponent', () => {8 it('should create the app', () => {9 const component = createComponent(AppComponent);10 expect(component).toBeTruthy();11 });12});13import { createComponent } from 'ng-mocks';14import { AppComponent } from './app.component';15describe('AppComponent', () => {16 it('should create the app', () => {17 const component = createComponent(AppComponent);18 expect(component).toBeTruthy();19 });20});21import { createComponent } from 'ng-mocks';22import { AppComponent } from './app.component';23describe('AppComponent', () => {24 it('should create the app', () => {25 const component = createComponent(AppComponent);26 expect(component).toBeTruthy();27 });28});29import { createComponent } from 'ng-mocks';30import { AppComponent } from './app.component';31describe('AppComponent', () => {32 it('should create the app', () => {33 const component = createComponent(AppComponent);34 expect(component).toBeTruthy();35 });36});37import { createComponent } from 'ng-mocks';38import { AppComponent } from './app.component';39describe('AppComponent', () => {40 it('should create the app', () => {41 const component = createComponent(AppComponent);42 expect(component).toBeTruthy();43 });44});45import { createComponent } from 'ng-mocks';46import { AppComponent } from './app.component';47describe('AppComponent', () => {48 it('should create the app', () => {49 const component = createComponent(AppComponent);50 expect(component).toBeTruthy();51 });52});53import { createComponent } from 'ng-mocks';54import { AppComponent } from './app.component';55describe('AppComponent', () => {56 it('should create the app', () => {57 const component = createComponent(AppComponent);58 expect(component).toBeTruthy();59 });60});61import { createComponent }

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 ng-mocks 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