ember-native-class-codemod icon indicating copy to clipboard operation
ember-native-class-codemod copied to clipboard

Ignore test files during runtime data gathering

Open rwjblue opened this issue 6 years ago • 1 comments

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.

rwjblue avatar Jun 24 '19 15:06 rwjblue

In order to fix this we need to do the following:

  1. Add 'tests' to const SKIPPED_MODULES = ['fetch/ajax'];
  2. 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.

rajasegar avatar Jun 25 '19 12:06 rajasegar