Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

index spec files fail #224

Closed
billyjanitsch opened this issue Nov 16, 2015 · 6 comments
Closed

index spec files fail #224

billyjanitsch opened this issue Nov 16, 2015 · 6 comments

Comments

@billyjanitsch
Copy link
Contributor

// test/index.spec.js
import test from 'ava'

test('dummy', t => {
  t.end()
})

Running AVA on this file yields:

  ✔ test › index › dummy
Uncaught Exception:  /Users/billy/projects/ava-test/node_modules/deep-extend/test/index.spec.js
  Error: Cannot find module 'should'
    at Object.<anonymous> (/Users/billy/projects/ava-test/node_modules/deep-extend/test/index.spec.js:5:14)
    at requireFromString (/Users/billy/projects/ava-test/node_modules/require-from-string/index.js:26:4)

Appears to be an issue with require-from-string.

@vadimdemedes
Copy link
Contributor

@floatdrop could you please confirm?

@jamestalmage
Copy link
Contributor

The issue is not with require-from-string.

You have deep-extend installed, which ships with it's own test/index.spec.js, and that is getting picked up with whatever glob string you are using.

Maybe AVA should avoid picking up files in node_modules, even if their glob string says too.

unclechu/node-deep-extend#21


➜  ava-test  ava

  ✔ dummy

  1 test passed

@billyjanitsch
Copy link
Contributor Author

Ah, my mistake, thanks for clarifying!

@jamestalmage
Copy link
Contributor

@billyjanitsch
Were you using the default glob string, or specifying your own? We should probably prevent AVA from picking that sort of file up by default.

@billyjanitsch
Copy link
Contributor Author

I was specifying my own, and forgot that it would pick up node_modules.

@jamestalmage
Copy link
Contributor

happens to the best of us.

I opened #226 to discuss the possibility of protecting against this sort of mistake.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants