Open bugeats opened 6 years ago
This has been merged in and included in the v3.1.0 release in our Homebrew tap and on GitHub.
Along a similar vein our in-house stlye is to have .unit.test.js
(and .integration.test.js
) too. I could add this one case, but it's probably a bit specific to our naming scheme only.
Should I open a PR to add support for \.(?:[^.]+\.)?.test.js
?
Yeah, I was thinking about adding .test.js
as well.
@bugeats @ashb I dug into the issues in more details. It is a side effect of the test classification regex not being correct and no fallback based on the scoring without test classification happening. So, I spun up a branch called add_fallback
. It would be great if you could pull down the branch, build it and test it and let me know if this helps.
From commit 771de9e
$ /Users/ash/code/tmp/alt/target/release/alt src/lib/directives/auth/index.unit.test.js; echo src/lib/jwt/index.unit.test.js
So it now returns something rather than nothing, but not even close to the right value for me - it's picked a totally different directory.
src/lib/directives/auth/index.unit.test.js
<-> src/lib/directives/auth/index.js
is the pairing I would expect here.
@ashb grab the latest add_fallback
branch and try it agin. Should be commit 78a82b4 and let me know.
@ashb did you ever verify this?
@drewdeponte Sorry, no I somehow missed the notification.
Still no dice on commit 78a82b4, and the minimal repro of just those files doesn't exhibit this behaviour, so something else is about this (private, sorry can't share it) is causing the issue.
Non-repro:
$ mkdir -p src/lib/directives/auth/ src/lib/jwt/
$ touch {src/lib/jwt/,src/lib/directives/auth/}index{.unit.test,}.js
Ah, add in ./src/lib/directives/index.js
and it fails.
Repro steps @drewdeponte:
mkdir -p src/lib/directives/auth/ src/lib/jwt/
touch {src/lib/jwt/,src/lib/directives/auth/}index{.unit.test,}.js
touch ./src/lib/directives/index.js
Which then gives this behaviour:
$ ../target/release/alt src/lib/directives/auth/index.unit.test.js
src/lib/jwt/index.unit.test.js
I just released a new major release of this, v4.0.0 which should resolve these issues I believe.
I'm surprised to see that this doesn't work:
I would expect discovery of:
... and vise-versa.