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 jest-function for Typescript-mode #22

Closed
davazp opened this issue Mar 6, 2021 · 4 comments · Fixed by #25
Closed

Support jest-function for Typescript-mode #22

davazp opened this issue Mar 6, 2021 · 4 comments · Fixed by #25

Comments

@davazp
Copy link

davazp commented Mar 6, 2021

The jest-function uses js2, so it does not work on other modes like typescript-mode.

A few ideas:

  • one option could be to just add code to get the same information from other modes.
  • another one could be to have some basic heuristics and not rely on js2-mode at all. So using some basic regular expressions to extract the path of describe/it strings.
  • Maybe another libraries like like lsp, imenu, could be used?
@lazyskulptor
Copy link
Contributor

I made a function extracting test name from buffer. Please check and give some advices to improve.

#25

@PierreRambaud
Copy link

is it possible to go further with this PR, it's really interesting?
If the maintainer is not able to test and do something, maybe some people are interesting to help :)

@edmundmiller edmundmiller linked a pull request Jun 29, 2022 that will close this issue
@edmundmiller
Copy link
Owner

is it possible to go further with this PR, it's really interesting? If the maintainer is not able to test and do something, maybe some people are interesting to help :)

Thanks for reviewing that! I haven't been writing much JS myself recently, so I haven't been using it.

I used this repo to test however in case that's of use in the future, so we can reproduce results https://github.com/Lemoncode/jest-testing-by-sample/tree/master/frontend/02%20Plain%20Vanilla

@lazyskulptor
Copy link
Contributor

is it possible to go further with this PR, it's really interesting?
If the maintainer is not able to test and do something, maybe some people are interesting to help :)

Thanks for review. I found some bugs on my code.
When there are special symbols in test name, It doesn't work.
ASAP I will try to fix it.

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

Successfully merging a pull request may close this issue.

4 participants