Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ianks/nicetest
minitest + cli + colors
https://github.com/ianks/nicetest
minitest rails ruby
Last synced: 3 months ago
JSON representation
minitest + cli + colors
- Host: GitHub
- URL: https://github.com/ianks/nicetest
- Owner: ianks
- License: mit
- Created: 2024-07-10T20:45:29.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2024-09-20T23:09:21.000Z (4 months ago)
- Last Synced: 2024-09-27T15:01:28.267Z (4 months ago)
- Topics: minitest, rails, ruby
- Language: Ruby
- Homepage:
- Size: 56.6 KB
- Stars: 27
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# ☀️ nicetest
Enhance your minitest experience with nicetest—a gem offering a CLI, pretty
assertion diffs, pre-configured reporters, focus checks, and colorful backtrace
filters for seamless test running.## Features
- A decent CLI for running tests, which is compatible with existing minitest plugin options
- Fancier diffs using [`super_diff`](https://github.com/mcmire/super_diff)
- Bundled [`minitest-reporters`](https://github.com/minitest-reporters/minitest-reporters), with defaults configured
- Bundled [`minitest-focus`](https://github.com/minitest/minitest-focus), with CI sanity check
- A pretty backtrace filter## Usage
### Take it with you
`nicetest` runs well on most `minitest` suites without hassle, so you can just
use it wherever you happen to be:```sh
# Gem install it
$ gem install nicetest# Go into a repo
$ git clone https://github.com/Shopfy/liquid; cd liquid; bundle install# Run a test
❯ nicetest --reporter doc test/integration/capture_test.rb:14
Started with run options --reporter doc --name=/CaptureTest#test_capture_with_hyphen_in_variable_name/ --seed 24518CaptureTest
test_capture_with_hyphen_in_variable_name PASS (0.00s)Finished in 0.00115s
1 tests, 1 assertions, 0 failures, 0 errors, 0 skips# JUnit is easy
❯ nicetest --reporter junit,progress
Emptying /Users/ianks/Code/Shopify/liquid/tmp/nicetest/junit/1721874837
Started with run options --reporter junit,progress --seed 36139799/799: [================================================================================] 100% Time: 00:00:00, Time: 00:00:00
Writing XML reports to /Users/ianks/Code/Shopify/liquid/tmp/nicetest/junit/1721874837Finished in 0.94625s
799 tests, 1924 assertions, 0 failures, 0 errors, 0 skips# Filter by name
❯ nicetest --name=/assign/
Started with run options --name=/assign/ --seed 4473433/33: [====================================================================================] 100% Time: 00:00:00, Time: 00:00:00
Finished in 0.03157s
33 tests, 69 assertions, 0 failures, 0 errors, 0 skips
```### Add to project
Add to your `test_helper.rb`:
```ruby
# test/test_helper.rbrequire "nicetest"
# whatever else you do... can probably remove some stuff
```Then, make it easy to run:
```sh
# Add to Gemfile
$ bundle add nicetest# Make a bin/test executable
$ bundle binstub nicetest && mv bin/nicetest bin/test
```You can run it now:
```sh
# Run tests
$ bin/test# In CI
$ bin/test --reporter doc,junit
```### What about Rakefile?
If you want to use Rake, just do this:
```ruby
# Rakefiletask :test do
sh("bin/test")
end
```## Recognition
- [minitest] for superb testing
- [minitest-reporters] for the excellent reporting
- [super_diff] for the pretty diffs
- [prism] for the blissful parser
- [pastel] for the pretty colors## Contributing
Bug reports and pull requests are welcome on GitHub at
https://github.com/ianks/nicetest.## License
The gem is available as open source under the terms of the [MIT
License](https://opensource.org/licenses/MIT).[minitest]: https://github.com/minitest/minitest
[minitest-reporters]: https://github.com/minitest-reporters/minitest-reporters
[super_diff]: https://github.com/mcmire/super_diff
[prism]: https://github.com/ruby/prism
[pastel]: https://github.com/piotrmurach/pastel