-
-
Notifications
You must be signed in to change notification settings - Fork 10
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
importLocal(__filename) returning an empty object, leading to local install which does not exist and skipping all ava tests #6
Comments
I'm getting the same thing using yarn workspaces. User reported that my CLI had stopped working when in a subdirectory of a repo. Reproduction Repo: https://github.com/aaronjensen/webpack-nano-0.6.3-subdirectory-repro I've confirmed that the cause is the same. Returned object from require is |
Got the same issue and tracked it back to this. I had to settle for using ava |
Fixed by #5 |
hi Sindre, maintainers and everybody else,
I would like to report a very strange issue and I hope you'll be able to shine some light on it.
I found that my
ava
, installed as a devdependency, was doing nothing, just silently exiting without an error. I placed someconsole.log
s in the files innode_modules
and it lead to this package,import-local
— specifically,require(localFile)
was returning an empty plain object:now
true
+true
+{}
= empty plain object{}
and it's truthy, which caused lineif (importLocal(__filename))
to just do nothing:There was no globally installed package (ava) but
importLocal
above was returning truthy empty object and there was nowhere to run the tests on.Do you have a clue what is going on?
By the way, if I clone this repo,
npm i
and run tests, they fail the "global" test:What's also strange, my GItLab CI also has this issue and this morning ava unit tests seem to have silently skipped on the CI. That's Linux on a clean slate so something really strange is going on.
Maybe we should add more checks, for example, does
importLocal(__filename)
result object have keys (if it's an object)?Thank you.
The text was updated successfully, but these errors were encountered: