hi how can I get jest coverage to ignore certain ...
# suitescript
s
hi how can I get jest coverage to ignore certain paths this is my current version which doesn't seem to work
Copy code
const SuiteCloudJestConfiguration = require("@oracle/suitecloud-unit-testing/jest-configuration/SuiteCloudJestConfiguration");
const cliConfig = require("./suitecloud.config");
const SuiteCloudJestStubs = require("suitecloud-unit-testing-stubs/SuiteCloudJestStubs");
module.exports = SuiteCloudJestConfiguration.build({
  projectFolder: cliConfig.defaultProjectFolder,
  projectType: SuiteCloudJestConfiguration.ProjectType.ACP,
  customStubs: SuiteCloudJestStubs.customStubs,
  coveragePathIgnorePatterns: [
    "/node_modules/",
    "/lib/moment\\.min\\.js$", // Escape the dots and make sure the path ends with moment.min.js
  ]
});
e
Note that the
build
function doesn't support all Jest options. I typically use a config file like:
Copy code
module.exports = {
  ...SuiteCloudJestConfiguration.build({
    projectFolder: cliConfig.defaultProjectFolder,
    projectType: SuiteCloudJestConfiguration.ProjectType.ACP,
    customStubs: SuiteCloudJestStubs.customStubs
  }),
  coveragePathIgnorePatterns: [
    "/node_modules/",
    "/lib/moment\\.min\\.js$", // Escape the dots and make sure the path ends with moment.min.js
  ]
}
So here I've pushed the
build
result down a layer and extracted your
coveragePathIgnorePatterns
out to the top level
s
thanks my tests stats are back up
1