Skip to content

Ava rerunning all tests when changing single test file, when using .ts files. #2085

@pollard93

Description

@pollard93

Description

Ava rerunning all tests when changing single test file, when using .ts files.

Error Message & Stack Trace

ava:watcher Detected change of path/to/testFile.ts +0ms
ava:watcher Sources remain that cannot be traced to specific tests: [ 'path/to/testFile.ts' ] +103ms
ava:watcher Rerunning all tests +1ms

Config

Copy the relevant section from package.json:

{
  "ava": {
    "compileEnhancements": false,
    "extensions": [
      "ts"
    ],
    "require": [
      "ts-node/register"
    ],
    "files": [
      "path/to/testFile.ts",
    ],
    "verbose": true
  }
}

Command-Line Arguments

DEBUG=ava:watcher npm test -- --watch --verbose

The cause (I believe)

node_modules/ava/lib/watcher.js:370 filters dirtyTests using the isTest function (node_modules/ava/lib/ava-files.js:208) which requires files to have a .js extension to resolve.

Environment

Tell us which operating system you are using, as well as which versions of Node.js, npm, and AVA. Run the following to get it quickly:

Node.js v11.4.0
darwin 18.2.0
ava: 1.4.0
npm: 6.4.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugcurrent functionality does not work as desiredhelp wanted

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions