You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ERR ./tests/integration/components/tag-input-test.js Transformation error (Cannot read property 'some' of undefined)
TypeError: Cannot read property 'some' of undefined
at new ModuleInfo (/Users/ilya/.npm/_npx/26337/lib/node_modules/ember-qunit-codemod/transforms/convert-module-for-to-setup-test/index.js:62:49)
at createModule (/Users/ilya/.npm/_npx/26337/lib/node_modules/ember-qunit-codemod/transforms/convert-module-for-to-setup-test/index.js:330:24)
at NodePath.bodyPath.each.expressionPath (/Users/ilya/.npm/_npx/26337/lib/node_modules/ember-qunit-codemod/transforms/convert-module-for-to-setup-test/index.js:700:28)
at NodePath.each (/Users/ilya/.npm/_npx/26337/lib/node_modules/ember-qunit-codemod/node_modules/ast-types/lib/path.js:101:26)
at processBody (/Users/ilya/.npm/_npx/26337/lib/node_modules/ember-qunit-codemod/transforms/convert-module-for-to-setup-test/index.js:697:16)
at updateModuleForToNestedModule (/Users/ilya/.npm/_npx/26337/lib/node_modules/ember-qunit-codemod/transforms/convert-module-for-to-setup-test/index.js:748:5)
at module.exports (/Users/ilya/.npm/_npx/26337/lib/node_modules/ember-qunit-codemod/transforms/convert-module-for-to-setup-test/index.js:974:3)
import{run,next}from'@ember/runloop';import{A}from'@ember/array';import{setupRenderingTest}from'ember-qunit';import{module,test}from'qunit';import{render}from'@ember/test-helpers';importhbsfrom'htmlbars-inline-precompile';import{typeInInput,typeCharacterInInput}from'../../helpers/ember-tag-input';constKEY_CODES={BACKSPACE: 8};module('tag-input','Integration | Component | Ember Tag Input',function(hooks){setupRenderingTest(hooks);test('New tags are created when delimiter characters are typed',asyncfunction(assert){assert.expect(4);consttags=A();this.addTag=function(tag){tags.pushObject(tag);};this.set('tags',tags);awaitrender(hbs` {{#tag-input tags=tags addTag=(action addTag) as |tag| }} {{tag}} {{/tag-input}} `);constdone=assert.async();run(()=>{typeInInput('.js-ember-tag-input-new','first second ');next(()=>{assert.equal($('.js-ember-tag-input-new').text(),'');assert.equal($('.emberTagInput-tag').length,2);assert.equal($('.emberTagInput-tag').eq(0).text().trim(),'first');assert.equal($('.emberTagInput-tag').eq(1).text().trim(),'second');done();});});});test('New tags are created when the field is blurred',asyncfunction(assert){assert.expect(3);consttags=A();this.addTag=function(tag){tags.pushObject(tag);};this.set('tags',tags);awaitrender(hbs` {{#tag-input tags=tags addTag=(action addTag) as |tag| }} {{tag}} {{/tag-input}} `);constdone=assert.async();run(()=>{typeInInput('.js-ember-tag-input-new','blurry');$('.js-ember-tag-input-new').blur();next(()=>{assert.equal($('.js-ember-tag-input-new').text(),'');assert.equal($('.emberTagInput-tag').length,1);assert.equal($('.emberTagInput-tag').eq(0).text().trim(),'blurry');done();});});});test('Tags can be removed using the backspace key',asyncfunction(assert){assert.expect(5);consttags=A();this.addTag=function(tag){tags.pushObject(tag);};this.removeTagAtIndex=function(index){tags.removeAt(index);};this.set('tags',tags);awaitrender(hbs` {{#tag-input tags=tags addTag=(action addTag) removeTagAtIndex=(action removeTagAtIndex) as |tag| }} {{tag}} {{/tag-input}} `);constdone=assert.async();run(()=>{typeInInput('.js-ember-tag-input-new','removeme ');next(()=>{assert.equal($('.js-ember-tag-input-new').text(),'');assert.equal($('.emberTagInput-tag').length,1);typeCharacterInInput('.js-ember-tag-input-new',String.fromCharCode(KEY_CODES.BACKSPACE));next(()=>{assert.equal($('.emberTagInput-tag').length,1);assert.equal($('.emberTagInput-tag--remove').length,1);typeCharacterInInput('.js-ember-tag-input-new',String.fromCharCode(KEY_CODES.BACKSPACE));next(()=>{assert.equal($('.emberTagInput-tag').length,0);done();});});});});});test('Tags can contain spaces when allowSpacesInTags is set to true',asyncfunction(assert){assert.expect(3);consttags=A();this.addTag=function(tag){tags.pushObject(tag);};this.set('tags',tags);awaitrender(hbs` {{#tag-input tags=tags addTag=(action addTag) allowSpacesInTags=true as |tag| }} {{tag}} {{/tag-input}} `);constdone=assert.async();run(()=>{typeInInput('.js-ember-tag-input-new','multiple words rock');$('.js-ember-tag-input-new').blur();next(()=>{assert.equal($('.js-ember-tag-input-new').text(),'');assert.equal($('.emberTagInput-tag').length,1);assert.equal($('.emberTagInput-tag').eq(0).text().trim(),'multiple words rock');done();});});});test('Tags can\'t be added or removed in read only mode',asyncfunction(assert){assert.expect(5);consttags=A(['hamburger','cheeseburger']);this.set('tags',tags);awaitrender(hbs` {{#tag-input tags=tags readOnly=true as |tag| }} {{tag}} {{/tag-input}} `);assert.equal($('.emberTagInput-tag').length,2);assert.equal($('.emberTagInput-remove').length,0);assert.equal($('.emberTagInput-new').length,1);const$input=$('.emberTagInput-new input');assert.equal($input.length,1);assert.ok($input.prop('disabled'));});test('send input value when typing',asyncfunction(assert){consttags=A();this.addTag=function(tag){tags.pushObject(tag);};this.set('tags',tags);letinputValue;this.onKeyUp=function(value){inputValue=value;};awaitrender(hbs` {{#tag-input tags=tags addTag=(action addTag) onKeyUp=(action onKeyUp) as |tag| }} {{tag}} {{/tag-input}} `);constdone=assert.async();run(()=>{typeCharacterInInput('.js-ember-tag-input-new','t','keyup');assert.equal(inputValue,'t');typeCharacterInInput('.js-ember-tag-input-new','e','keyup');assert.equal(inputValue,'te');typeCharacterInInput('.js-ember-tag-input-new','s','keyup');assert.equal(inputValue,'tes');$('.js-ember-tag-input-new').blur();next(()=>{assert.equal($('.emberTagInput-tag').length,1);assert.equal($('.emberTagInput-tag').eq(0).text().trim(),'tes');assert.equal(inputValue,'');done();});});});test('Tags can be added after readOnly changes to false',asyncfunction(assert){assert.expect(4);consttags=A();this.addTag=function(tag){tags.pushObject(tag);};this.set('tags',tags);this.set('readOnly',true);awaitrender(hbs` {{#tag-input tags=tags addTag=(action addTag) readOnly=readOnly as |tag| }} {{tag}} {{/tag-input}} `);constdone=assert.async();run(()=>{this.set('readOnly',false);typeInInput('.js-ember-tag-input-new','some tag ');next(()=>{assert.equal($('.js-ember-tag-input-new').text(),'');assert.equal($('.emberTagInput-tag').length,2);assert.equal($('.emberTagInput-tag').eq(0).text().trim(),'some');assert.equal($('.emberTagInput-tag').eq(1).text().trim(),'tag');done();});});});test('Tags can\'t be added or removed after readOnly changes from false to true',asyncfunction(assert){assert.expect(5);consttags=A(['hamburger','cheeseburger']);this.set('tags',tags);this.set('readOnly',false);awaitrender(hbs` {{#tag-input tags=tags readOnly=true as |tag| }} {{tag}} {{/tag-input}} `);constdone=assert.async();run(()=>{this.set('readOnly',true);next(()=>{assert.equal($('.emberTagInput-tag').length,2);assert.equal($('.emberTagInput-remove').length,0);assert.equal($('.emberTagInput-new').length,1);const$input=$('.emberTagInput-new input');assert.equal($input.length,1);assert.ok($input.prop('disabled'));done();});});});});
The text was updated successfully, but these errors were encountered:
I've been hitting this as well for stock-generated unit tests for helpers. This is the triggering "it exists" code.
import{module,test}from'qunit';import{setupTest}from'ember-qunit';module('transform:int10000','Unit | Transform | int10000',function(hooks){setupTest(hooks);// Replace this with your real tests.test('it exists',function(assert){lettransform=this.owner.lookup('transform:int10000');assert.ok(transform);});});
Code is (from https://github.com/calvinlough/ember-tag-input)
The text was updated successfully, but these errors were encountered: