npm @oclif/test 4.0.1

latest releases: 4.0.9, 4.0.8, 4.0.7...
4 months ago

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 executed
  • runCommand - run a command within your CLI. All output to stderr and stdout will be captured
  • runHook - run a hook within your CLI. All output to stderr and stdout will be captured

See the migration guide and the usage for more

Don't miss a new test release

NewReleases is sending notifications on new releases.