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

Is there a way to jump to a test named the same way but in a different directory? #1019

Closed
blaenk opened this issue Jun 9, 2016 · 4 comments
Labels

Comments

@blaenk
Copy link

blaenk commented Jun 9, 2016

I've been looking through the code but it seems like the only way to influence the test file checker only considers the file base name. I'm currently in the situation where the project I'm working on arranges tests like this:

  • src/some-file.js
  • test/some-file.js

Is there any way to teach projectile about this?

@jordonbiondo
Copy link

jordonbiondo commented Nov 23, 2016

I began work on supporting ember-cli projects and ran into this same issue. The structure of ember-cli projects are well defined and the interface lends itself well to other parts of projectile, but not test-implementation jumping.

A way to override the standard suffix/prefix matching behavior with something more flexible, such as configurable hook would be great.

In ember you often have structures that look like this:

  • app
    • user
      • model.js
    • thing
      • model.js
  • test
    • user
      • model-test.js
    • thing
      • model-test.js

These situations cause projectile to potentially jump to the wrong test file for a given implementation file if you added -test suffix support for the project type.

If we can agree on an approach to solve this issue, I'd be happy to work on a PR.

Would it be possible to abstract the current prefix/suffix behavior into what would be the default implementation of a more generic file to file matching system? I'd imagine that the API wouldn't need to change as it would use the same "is a file a test file", "get the test for this file" and "get the file for this test" functions that exist now. But those functions would need to be modified so their current implementations are abstracted into something that can be configured per project type.

@Qquanwei
Copy link

Qquanwei commented May 5, 2017

+1

@stale
Copy link

stale bot commented May 8, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contribution and understanding!

@stale stale bot added the Stale label May 8, 2019
@stale
Copy link

stale bot commented Jun 7, 2019

This issues been automatically closed due to lack of activity. Feel free to re-open it if you ever come back to it.

@stale stale bot closed this as completed Jun 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants