Skip to content

Commit fc75b4b

Browse files
author
Kelly Selden
committed
supporting test modifications
1 parent 0e74a6f commit fc75b4b

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

test/tests.js

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ const {
1313
assertCodemodRan
1414
} = require('./helpers/assertions');
1515
const manifest = require('../manifest');
16+
const run = require('ember-cli-update/src/run');
1617

1718
const codemods = Object.keys(manifest);
1819

@@ -83,9 +84,15 @@ describe('runs codemods', function() {
8384
runCodemods: true,
8485
async beforeMerge() {
8586
await _merge('local', tmpPath);
87+
88+
if (manifest[codemod].script) {
89+
await run('npm install', { cwd: tmpPath });
90+
}
8691
}
8792
});
8893

94+
ps.stdout.pipe(process.stdout);
95+
8996
function stdoutData(data) {
9097
let str = data.toString();
9198
if (str.includes('These codemods apply to your project.')) {
@@ -104,9 +111,17 @@ describe('runs codemods', function() {
104111
status
105112
} = await promise;
106113

114+
assertNoUnstaged(status);
115+
assertCodemodRan(status);
116+
117+
await fs.remove(path.join(tmpPath, 'package-lock.json'));
118+
107119
// file is indeterminent between OS's, so ignore
108120
await fs.remove(path.join(tmpPath, 'MODULE_REPORT.md'));
109121

122+
// remove dist and node_modules before fixture compare
123+
await run('git clean -fdX', { cwd: tmpPath });
124+
110125
let nodeVersion = 'latest-node';
111126
if (process.env.NODE_LTS) {
112127
nodeVersion = 'min-node';
@@ -122,9 +137,6 @@ describe('runs codemods', function() {
122137
fixtureCompare({
123138
mergeFixtures
124139
});
125-
126-
assertNoUnstaged(status);
127-
assertCodemodRan(status);
128140
});
129141
}
130142
});

0 commit comments

Comments
 (0)