export { className } from "path";
export { className1} from "path";
export { className2 } from "path";
export { className3 } from "path";
该文件仅包含上述几行,我们是否应该为此类文件编写单元测试用例,如果是,请建议如何为此编写单元测试用例。
提前致谢
最佳答案
无需为仅导出某些内容的文件编写测试。如果您有 coverageThreshold
,只需忽略这些文件
// jest.config.js
module.exports = {
...
collectCoverage: true,
collectCoverageFrom: [
'path/to/collect/**',
'!path/to/ignore/**',
],
coverageThreshold: {
global: {
...
},
},
};
关于javascript - 如何为以下代码片段编写单元测试用例,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60595860/