screeps-typescript-starter icon indicating copy to clipboard operation
screeps-typescript-starter copied to clipboard

Code Coverage

Open wolframhaussig opened this issue 3 years ago • 0 comments

Hi,

I am trying to integrate Code Coverage into my screeps project(Mocha is already running fine). This is what I have so far:

  • installed dev dependencies
    • @istanbuljs/nyc-config-typescript
    • nyc
    • source-map-support
  • added to mocha.opts --require source-map-support/register
  • added new script: "coverage": "nyc npm run test"
  • added nyc config
  "nyc": {
    "extends": "@istanbuljs/nyc-config-typescript",
    "all": true,
    "require": [
      "ts-node/register"
    ],
    "excludes": [
      "**/*.d.ts"
    ],
    "reporter": [
      "text",
      "lcov"
    ]
  }

Now, when trying to run the coverage I get the following error:

An error occurred while trying to read the map file at F:\Workspace\screeps\dist\main.js.map
Error: ENOENT: no such file or directory, open 'F:\Workspace\screeps\dist\main.js.map'

This is true because the sourcemap is called main.js.map.js... Has anyone already got this to work and give me a hint what to do here?

Best regards Wolfram

wolframhaussig avatar Aug 18 '21 17:08 wolframhaussig