Skip to content

0.1.3 - Rename package to `cli-testing-tool`

Choose a tag to compare

@saurabhdaware saurabhdaware released this 02 Nov 14:09
· 6 commits to main since this release

Renamed this package from cli-testing-library to cli-testing-tool.

Earlier the idea was to make this package something like testing-library so named it cli-testing-library. However, most of the terminology from testing-library (render, findByText, etc) doesn't make sense in CLIs. So we'll be moving away from that terminology a bit (the overall structure will still remain similar).

Also, @crutchcorn is working on a similar idea where they are creating a testing library with syntax similar to testing-library so it made sense for them to have name cli-testing-library (Check out cli-testing-library)

This will the new terminology I will be going forward with -

  • render -> execute
  • findByText -> There won't be any equivalent. You can always do stringOutput.includes('text-to-find') as a replacement
  • screen -> terminal

New methods-
terminal.stringOutput - to get output as string
terminal.tokenizeOutput - to get output with color and graphics tokens

Migration

Hopefully, no one is using this library yet but if you are,

1. Installation

npm uninstall --save-dev cli-testing-library
npm install --save-dev cli-testing-tool@latest

2. Rename imports

- const {} = require('cli-testing-library')
+ const {} = require('cli-testing-tool')