ember-native-class-codemod
ember-native-class-codemod copied to clipboard
Ignore test files during runtime data gathering
Apps that emit linting tests into the build currently emit a warning during telemetry gathering for each linted module:
error evaluating `input/special-sauce/tests/addon.lint-test`: QUnit is not defined
error evaluating `input/special-sauce/tests/templates.template.lint-test`: QUnit is not defined
We already ignore test files when transforming, we should ensure that we do not log these warnings for test files.
In order to fix this we need to do the following:
- Add 'tests' to
const SKIPPED_MODULES = ['fetch/ajax']; - Check the SKIPPED_MODULES before logging here https://github.com/ember-codemods/ember-native-class-codemod/blob/aa96feffc8f9cca7ec6f5bb9577d17b61f0b9c72/lib/gather-telemetry.js#L38 like
// log the error, but continue
if (!SKIPPED_MODULES.includes(modulePath)) {
window.logErrorInNodeProcess(`error evaluating \`${modulePath}\`: ${error.message}`);
}
Will create a PR if this is the right fix.