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

add status constants #334

Closed
TheSnakeWitcher opened this issue Dec 19, 2023 · 2 comments
Closed

add status constants #334

TheSnakeWitcher opened this issue Dec 19, 2023 · 2 comments

Comments

@TheSnakeWitcher
Copy link
Contributor

TheSnakeWitcher commented Dec 19, 2023

Hi, I am developing an adapter to integrate neotest with hardhat. I have a code like these

M.STATUS = {
    passed = "passed",
    skiped = "skipped",
    failed = "failed",
}

And I found that neotest-go adapter here has a code like these

local test_statuses = {
   -- ...
  pass = "passed", -- the test passed
  fail = "failed", -- the test or benchmark failed
  skip = "skipped", -- the test was skipped or the package contained no tests
}

I think that probably other adapters use similar declarations to set the status field of a neotest.Result Maybe these constants could be defined in neotest, that way all plugins could use it and we avoid code duplication, maybe a module like neotest.lib.constants would be cool.

I personally use these other constants too when computing command field of the neotest.RunSpec.

NODE_TYPES = {
    dir = "dir",
    file = "file",
    namespace = "namespace",
    test = "test",
}
rcarriga added a commit that referenced this issue Dec 20, 2023
@rcarriga
Copy link
Collaborator

I've added enums for both to neotest.types 😄

@TheSnakeWitcher
Copy link
Contributor Author

Nice work, chears 😄

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

2 participants