Skip to content

rewritePaths is less restrictive than expected #14

Closed
@bitjson

Description

@bitjson

Thank you for this project! I migrated bitcoin-ts recently, and I just wanted to note an issue I had.

My Typescript project builds the same source to two different output locations, one build/main/ for Node.js usage and one build/module/ for consumers which use build tools like Rollup.

I primarily test against the build/main/ build, so the configuration seemed simple:

  "ava": {
    "typescript": {
      "rewritePaths": {
        "src/": "build/main/"
      }
    }
  }

But with that configuration, AVA was also trying to test files in the build/module/ folder. I ended up needing to add an exclusion:

  "ava": {
    "typescript": {
      "rewritePaths": {
        "src/": "build/main/"
      }
    },
    "files": [
      "!build/module/**"
    ]
  }

This works well now, so I'm happy to leave it as-is. I just wanted to mention that it differed from my initial impression of how rewritePaths would work. I thought setting src/ to build/main/ would map files in those directories one-to-one, but AVA seems to also be searching in build/module/ without the specific exclusion.

(Thanks again for v3 of AVA and the improved Typescript integration! Even debugging is working beautifully now.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentationhelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions