Skip to content

ava incorrectly ignores test files when the project itself is contained in node_modules directory #1173

@gajus

Description

@gajus

Description

I have two projects:

Due to the nature of the projects (process.pwd() aware dependency resolution), it is not possible to link isomorphic-webpack-demo inside isomorphic-webpack. Therefore, I need to do:

git clone https://github.com/gajus/isomorphic-webpack
git clone https://github.com/gajus/isomorphic-webpack-demo
(cd ./isomorphic-webpack && npm install)
(cd ./isomorphic-webpack-demo && npm install)
rm -fr ./isomorphic-webpack-demo/node_modules/isomorphic-webpack
cp ./isomorphic-webpack ./isomorphic-webpack-demo/node_modules

The problem happens when I try to run ava inside of isomorphic-webpack, i.e.

cd ./isomorphic-webpack-demo/node_modules/isomorphic-webpack
npm run test

I am getting error:

  1 exception

  ✖ Couldn't find any files to test

My guess (without looking at the source code), is that ava detects that ./isomorphic-webpack-demo/node_modules/isomorphic-webpack/test path includes node_modules and therefore ignores this path.

Expected behaviour: ava should detect the immediate ./test directory and run the tests.

Environment

node -e "var os=require('os');console.log('Node.js ' + process.version + '\n' + os.platform() + ' ' + os.release())"
ava --version
npm --version
Node.js v7.3.0
darwin 16.3.0
0.17.0
3.10.10

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugcurrent functionality does not work as desiredscope:globbing

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions