Skip to content

Commit

Permalink
supporting test modifications
Browse files Browse the repository at this point in the history
  • Loading branch information
Kelly Selden committed Nov 18, 2019
1 parent 0e74a6f commit fc75b4b
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions test/tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const {
assertCodemodRan
} = require('./helpers/assertions');
const manifest = require('../manifest');
const run = require('ember-cli-update/src/run');

const codemods = Object.keys(manifest);

Expand Down Expand Up @@ -83,9 +84,15 @@ describe('runs codemods', function() {
runCodemods: true,
async beforeMerge() {
await _merge('local', tmpPath);

if (manifest[codemod].script) {
await run('npm install', { cwd: tmpPath });
}
}
});

ps.stdout.pipe(process.stdout);

function stdoutData(data) {
let str = data.toString();
if (str.includes('These codemods apply to your project.')) {
Expand All @@ -104,9 +111,17 @@ describe('runs codemods', function() {
status
} = await promise;

assertNoUnstaged(status);
assertCodemodRan(status);

await fs.remove(path.join(tmpPath, 'package-lock.json'));

// file is indeterminent between OS's, so ignore
await fs.remove(path.join(tmpPath, 'MODULE_REPORT.md'));

// remove dist and node_modules before fixture compare
await run('git clean -fdX', { cwd: tmpPath });

let nodeVersion = 'latest-node';
if (process.env.NODE_LTS) {
nodeVersion = 'min-node';
Expand All @@ -122,9 +137,6 @@ describe('runs codemods', function() {
fixtureCompare({
mergeFixtures
});

assertNoUnstaged(status);
assertCodemodRan(status);
});
}
});

0 comments on commit fc75b4b

Please sign in to comment.