Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const travisYml = yaml('.travis.yml');
// Require .travis.yml
if (!travisYml.exists()) {
throw new MrmError(
`Run travis task first:
mrm travis`
);
}
const pkg = packageJson();
// Require coverage npm script
if (!pkg.getScript(coverageScript)) {
throw new MrmError(
`${coverageScript} npm script not found. To add Jest run:
mrm jest`
);
}
// .travis.yml
if (!travisYml.get('after_success', []).includes(uploadCommand)) {
travisYml
.merge({
script: [`npm run ${coverageScript}`],
after_success: [uploadCommand],
})
.save();
}