Skip to content

Improve mint test <test> glob handling and warning output #643

@farism

Description

@farism

On Discord I requested the ability to run a single test file, e.g.

mint test Main

and @gdotdesign said he thought it was already possible.

It turns out it is possible, but it requires passing the complete relative path to the test file, including the extension

So really, assuming test-files directory is the default, the above should be

mint test tests/Main.mint

Since you need to run mint from the root directory, this leads to a bit of ceremony with prepending directory names.

Based on experience with Jest and RSpec, I would think it more intuitive to support the following

  • Leaving extension name off since test files will always be .mint
  • Attempt to glob on the supplied <test> argument path but also some fallback paths if no test files are found
    • Automatically prepending the SourceFiles.tests directory

In addition to that, when you do pass in a glob argument where no files are found the warning message There are no tests to run! is a little misleading. It should probably be like Could not find any test files matching the test argument, or something like that.

Metadata

Metadata

Assignees

No one assigned

    Labels

    discussionenhancementNew feature or requesttoolingTooling related feature (formatter, documentation, production builder)

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions