Skip to content

Commit 6c2786c

Browse files
author
Kelly Selden
committed
support NullVoxPopuli/ember-cli-update-codemods-manifest/add-no-implicit-this
1 parent a2dc603 commit 6c2786c

File tree

10 files changed

+27
-5
lines changed

10 files changed

+27
-5
lines changed

src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ All blueprints are up-to-date!`;
194194
statsOnly,
195195
listCodemods,
196196
runCodemods,
197-
codemodsUrl: 'https://raw.githubusercontent.com/ember-cli/ember-cli-update-codemods-manifest/v3/manifest.json',
197+
codemodsUrl: 'https://raw.githubusercontent.com/ember-cli/ember-cli-update-codemods-manifest/ember-no-implicit-this-codemod/manifest.json',
198198
createCustomDiff,
199199
ignoredFiles: [await getBlueprintFilePath(cwd)],
200200
wasRunAsExecutable

test/acceptance/ember-cli-update-test.js

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -146,9 +146,14 @@ describe(function() {
146146
} = await merge({
147147
fixturesPath: 'test/fixtures/codemod/local',
148148
commitMessage: 'my-app',
149-
runCodemods: true
149+
runCodemods: true,
150+
async beforeMerge() {
151+
await run('npm install', { cwd: tmpPath });
152+
}
150153
});
151154

155+
ps.stdout.pipe(process.stdout);
156+
152157
ps.stdout.on('data', data => {
153158
let str = data.toString();
154159
if (str.includes('These codemods apply to your project.')) {
@@ -160,9 +165,17 @@ describe(function() {
160165
status
161166
} = await promise;
162167

168+
assertNoUnstaged(status);
169+
assertCodemodRan(status);
170+
171+
await fs.remove(path.join(tmpPath, 'package-lock.json'));
172+
163173
// file is indeterminent between OS's, so ignore
164174
await fs.remove(path.join(tmpPath, 'MODULE_REPORT.md'));
165175

176+
// remove dist and node_modules before fixture compare
177+
await run('git clean -fdX', { cwd: tmpPath });
178+
166179
let mergeFixtures = 'test/fixtures/codemod/latest-node/my-app';
167180
if (process.env.NODE_LTS) {
168181
mergeFixtures = 'test/fixtures/codemod/min-node/my-app';
@@ -171,9 +184,6 @@ describe(function() {
171184
fixtureCompare({
172185
mergeFixtures
173186
});
174-
175-
assertNoUnstaged(status);
176-
assertCodemodRan(status);
177187
});
178188

179189
it('scopes to sub dir if run from there', async function() {

test/fixtures/codemod/latest-node/my-app/app/controllers/application.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ import { assign } from '@ember/polyfills';
44
import { map } from '@ember/object/computed';
55

66
export default Controller.extend({
7+
controllerProperty: 'test',
8+
79
fullName: computed('firstName', 'lastName', function() {
810
return `${this.firstName} ${this.lastName}`;
911
}),

test/fixtures/codemod/latest-node/my-app/app/templates/application.hbs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,6 @@
22
<WelcomePage />
33
{{!-- Feel free to remove this! --}}
44

5+
{{this.controllerProperty}}
6+
57
{{outlet}}

test/fixtures/codemod/latest-node/my-app/codemods.log

Whitespace-only changes.

test/fixtures/codemod/local/my-app/app/controllers/application.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ import { merge } from '@ember/polyfills';
33
import { map } from '@ember/object/computed';
44

55
export default Ember.Controller.extend({
6+
controllerProperty: 'test',
7+
68
fullName: computed(function() {
79
return `${this.firstName} ${this.lastName}`;
810
}).property('firstName', 'lastName'),

test/fixtures/codemod/local/my-app/app/templates/application.hbs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,6 @@
22
<WelcomePage />
33
{{!-- Feel free to remove this! --}}
44

5+
{{controllerProperty}}
6+
57
{{outlet}}

test/fixtures/codemod/min-node/my-app/app/controllers/application.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ import { assign } from '@ember/polyfills';
44
import { map } from '@ember/object/computed';
55

66
export default Controller.extend({
7+
controllerProperty: 'test',
8+
79
fullName: computed('firstName', 'lastName', function() {
810
return `${this.firstName} ${this.lastName}`;
911
}),

test/fixtures/codemod/min-node/my-app/app/templates/application.hbs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,6 @@
22
<WelcomePage />
33
{{!-- Feel free to remove this! --}}
44

5+
{{this.controllerProperty}}
6+
57
{{outlet}}

test/fixtures/codemod/min-node/my-app/codemods.log

Whitespace-only changes.

0 commit comments

Comments
 (0)