gotwarlost / istanbul

Yet another JS code coverage tool that computes statement, line, function and branch coverage with module loader hooks to transparently add coverage when running tests. Supports all JS coverage use cases including unit tests, server side functional tests and browser tests. Built for scale.
Other
8.7k stars 786 forks source link

option to disable coverage on import lines #938

Open sammysium opened 3 years ago

sammysium commented 3 years ago

not sure what I am missing but I have the following import. I am in react-native jest environment and apparently this is an istanbul issue?

    import styles from './styles.js';

where style.js is

const styles = {
  siteSummaryValueSecondary: {
    fontWeight: 'bold',
    fontSize: 30,
    color: '#ff0000'
  },
  cardTitlePrimary: {
    fontSize: 16
  },
  pickerStyleSmall: { height: 50, width: 200 }
};
export default styles;

it is a lot longer than that and used in many UI components. Now jest says:

      import styles from './styles';EEIEIIII

what am I supposed to test here? Can import files be ignored from coverage report?