4.0.1
No more fancy-test
Why?
We're migrating away from fancy-test for a few reasons:
- it assumes people will use mocha as their test runner
- there's a learning curve to writing fancy tests. Most people know how like to write their tests and don't want to bother with learning a new test framework
- fancy-test offers a lot of useful utilities (like stubbing process.env) but it doesn't do everything that people need so people end up writing tests that are half fancy-tests and half "unfancy" tests. We'd rather enable people to write tests however they want.
- we don't have bandwidth to support it as fully as we would like
New Testing Utilities
There are now three functions exported by @oclif/test
captureOutput
- accepts a callback. All output to stderr and stdout will be captured while the callback is being executedrunCommand
- run a command within your CLI. All output to stderr and stdout will be capturedrunHook
- run a hook within your CLI. All output to stderr and stdout will be captured
See the migration guide and the usage for more