Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我目前正在使用带有 Play 框架的 Java。我有 JUnit 测试,我正在尝试使用 IntelliJ 覆盖运行程序来测量覆盖率。
不幸的是,Play 生成了一些垃圾类,IntelliJ 将它们包含在报告中。有没有办法从覆盖率报告中排除某些模式?
您可以通过编辑正在执行的测试(测试)的运行配置来指定将哪些类添加到覆盖率数据中。
选择测试后单击“编辑配置”,打开代码覆盖率设置选项卡,在“记录覆盖率数据的包和类”中,您可以缩小生产代码中包含在覆盖率记录中的包。