From dcc261ac7938ed90377598a5f69ff7b5f4989c7e Mon Sep 17 00:00:00 2001 From: Alex Alvarez Date: Mon, 13 Nov 2017 18:50:36 -0500 Subject: [PATCH 1/3] Adding nested test failing testcase --- __testfixtures__/ember-qunit-codemod/subject.input.js | 6 ++++-- __testfixtures__/ember-qunit-codemod/subject.output.js | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/__testfixtures__/ember-qunit-codemod/subject.input.js b/__testfixtures__/ember-qunit-codemod/subject.input.js index 573a8b1..3027bd2 100644 --- a/__testfixtures__/ember-qunit-codemod/subject.input.js +++ b/__testfixtures__/ember-qunit-codemod/subject.input.js @@ -24,8 +24,10 @@ test('has some thing', function (assert) { let subject = this.subject(); }); -test('has another thing', function (assert) { - let subject = this.subject({ size: 'big' }); +['big', 'small'].forEach((size) => { + test('has another thing', function (assert) { + let subject = this.subject({ size }); + }); }); moduleForModel('foo', 'Integration | Model | Foo', { diff --git a/__testfixtures__/ember-qunit-codemod/subject.output.js b/__testfixtures__/ember-qunit-codemod/subject.output.js index 7859b9b..8329e35 100644 --- a/__testfixtures__/ember-qunit-codemod/subject.output.js +++ b/__testfixtures__/ember-qunit-codemod/subject.output.js @@ -54,8 +54,10 @@ module('Unit | Component | FooBar', function(hooks) { let subject = this.owner.factoryFor('component:foo-bar').create(); }); - test('has another thing', function (assert) { - let subject = this.owner.factoryFor('component:foo-bar').create({ size: 'big' }); + ['big', 'small'].forEach((size) => { + test('has another thing', function (assert) { + let subject = this.owner.factoryFor('component:foo-bar').create({ size }); + }); }); }); From 6dd5a91315b3355dddc66b91f8cd76cb6ae04eb7 Mon Sep 17 00:00:00 2001 From: Alex Alvarez Date: Mon, 13 Nov 2017 19:03:08 -0500 Subject: [PATCH 2/3] Cleanup --- __testfixtures__/ember-qunit-codemod/subject.input.js | 2 +- __testfixtures__/ember-qunit-codemod/subject.output.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/__testfixtures__/ember-qunit-codemod/subject.input.js b/__testfixtures__/ember-qunit-codemod/subject.input.js index 3027bd2..5378f3a 100644 --- a/__testfixtures__/ember-qunit-codemod/subject.input.js +++ b/__testfixtures__/ember-qunit-codemod/subject.input.js @@ -24,7 +24,7 @@ test('has some thing', function (assert) { let subject = this.subject(); }); -['big', 'small'].forEach((size) => { +['big', 'small'].forEach(function (size) { test('has another thing', function (assert) { let subject = this.subject({ size }); }); diff --git a/__testfixtures__/ember-qunit-codemod/subject.output.js b/__testfixtures__/ember-qunit-codemod/subject.output.js index 8329e35..d85246b 100644 --- a/__testfixtures__/ember-qunit-codemod/subject.output.js +++ b/__testfixtures__/ember-qunit-codemod/subject.output.js @@ -54,7 +54,7 @@ module('Unit | Component | FooBar', function(hooks) { let subject = this.owner.factoryFor('component:foo-bar').create(); }); - ['big', 'small'].forEach((size) => { + ['big', 'small'].forEach(function (size) { test('has another thing', function (assert) { let subject = this.owner.factoryFor('component:foo-bar').create({ size }); }); From d9d6f34497ade76ea8cf73f22ece4940573047ac Mon Sep 17 00:00:00 2001 From: Alex Alvarez Date: Mon, 13 Nov 2017 20:14:34 -0500 Subject: [PATCH 3/3] Put it in the wrong place... still failing --- .../ember-qunit-codemod/subject.output.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/__testfixtures__/ember-qunit-codemod/subject.output.js b/__testfixtures__/ember-qunit-codemod/subject.output.js index d85246b..d368406 100644 --- a/__testfixtures__/ember-qunit-codemod/subject.output.js +++ b/__testfixtures__/ember-qunit-codemod/subject.output.js @@ -26,8 +26,10 @@ module('Unit | Model | Foo', function(hooks) { let subject = run(() => this.owner.lookup('service:store').createRecord('foo')); }); - test('has another thing', function (assert) { - let subject = run(() => this.owner.lookup('service:store').createRecord('foo', { size: 'big' })); + ['big', 'small'].forEach(function (size) { + test('has another thing', function (assert) { + let subject = this.owner.factoryFor('component:foo-bar').create({ size }); + }); }); }); @@ -54,10 +56,8 @@ module('Unit | Component | FooBar', function(hooks) { let subject = this.owner.factoryFor('component:foo-bar').create(); }); - ['big', 'small'].forEach(function (size) { - test('has another thing', function (assert) { - let subject = this.owner.factoryFor('component:foo-bar').create({ size }); - }); + test('has another thing', function (assert) { + let subject = this.owner.factoryFor('component:foo-bar').create({ size: 'big' }); }); });