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

Support for x.test.x #21

Open
bugeats opened this issue May 30, 2018 · 10 comments
Open

Support for x.test.x #21

bugeats opened this issue May 30, 2018 · 10 comments

Comments

@bugeats
Copy link

bugeats commented May 30, 2018

I'm surprised to see that this doesn't work:

alt ./crypto-helpers.test.js

I would expect discovery of:

./crypto-helpers.js

... and vise-versa.

@drewdeponte
Copy link
Owner

This has been merged in and included in the v3.1.0 release in our Homebrew tap and on GitHub.

@ashb
Copy link

ashb commented Apr 12, 2019

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?

@drewdeponte
Copy link
Owner

Yeah, I was thinking about adding .test.js as well.

@drewdeponte drewdeponte reopened this Apr 14, 2019
@drewdeponte
Copy link
Owner

@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.

@ashb
Copy link

ashb commented Apr 15, 2019

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.

@drewdeponte
Copy link
Owner

@ashb grab the latest add_fallback branch and try it agin. Should be commit 78a82b4 and let me know.

@drewdeponte
Copy link
Owner

@ashb did you ever verify this?

@ashb
Copy link

ashb commented Jan 13, 2022

@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

@ashb
Copy link

ashb commented Jan 13, 2022

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

@drewdeponte
Copy link
Owner

I just released a new major release of this, v4.0.0 which should resolve these issues I believe.

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