Several New Expectations
Originally published:
In the last two weeks, Best has seen several new releases beginning with a small SemVer breaking change. The change is in the format of the CLI output, so there is no need to update any of your tests or change the CLI command that you use to run Best.
But just in case you were piping Best's output to anything and depending on a particular format (which I don't necessarily recommend, but also I can't prevent you from doing), be aware that is the thing that has changed since v0.2.x.
This latest batch of v0.3.x releases includes several new expectations and the ability to create todo items in test files.
Recent Releases
- 2026-09-07: v0.3.0
- 2026-09-13: v0.3.2
- 2026-09-14: v0.3.3
- 2026-09-14: v0.3.4
- 2026-09-15: v0.3.5
- 2026-09-16: v0.3.6
New Expectations
Number Comparison
to_be_less_thanto_be_less_than_or_equalto_be_greater_thanto_be_greater_than_or_equal
String Comparison
to_be_lower_caseto_be_upper_caseto_start_withto_end_withto_containto_have_length
File System
to_be_fileto_be_readable_fileto_be_writable_fileto_be_directoryto_be_readable_directoryto_be_writable_directory
Todo Items
Todo items work pretty much the same as skipped tests. You can include or omit an expectation; either way the expectation is never run. Skipped tests and todo items are counted differently in the test output summary, in case you prefer one or the other for certain things.
For example:
it "should be a todo item"; todo
it "should also be a todo item"; {
todo
expect 1 # <-- This line will not run
to_be 1 # <-- This line will not run
}
Wrapping Up
There have been several internal refactorings and improvements to the source code and unit tests. The ./tests/ directory contains many examples of how to use each expectation and modifier.
Some official documentation will be coming soon, and Best will be getting some more expectations in the coming weeks. Best will also be getting hooks such as before_all, before_each, after_all, and after_each. Hooks are still currently in the design phase, and will likely require a bit of rewriting some of Best's internals, but API-breaking changes are not expected at this time.