Skip to content

Code Coverage #160

@wolframhaussig

Description

@wolframhaussig

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions