简体   繁体   中英

how to write unit test case for following code snippet

export { className } from "path";  
export { className1} from "path";  
export { className2 } from "path";
export { className3 } from "path";

This file contains only the above lines, Should we write unit test cases for these kind of files, If yes,Please suggest how to write unit test cases for this.

Thanks in Advance

There is no need to write tests for files that only exports something. If you have a coverageThreshold just ignore those files

// jest.config.js
module.exports = {
  ...
  collectCoverage: true,
  collectCoverageFrom: [
    'path/to/collect/**',
    '!path/to/ignore/**',
  ],
  coverageThreshold: {
    global: {
      ...
    },
  },
};

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM