RxT
RxT
stands for ReactiveX Testing. RxT
is built as a declarative testing
framework inspired by the potential for utilizing custom operators for
RxJS
Observables
to create a Domain Specific Language
(DSL
) for powerful, but readable testing. The DSL is modeled off of Behaviour
Driven Development (BDD
) terminology to drive feature development.
The power of Observables
enables RxT
to turn tests into powerful declarative
streams that are capable of handling a multitude of testing parameters for
variation in a single test as well as being able to test the results of
asynchronous side effects without messy nested callbacks. This results in the
ability of RxT
to handle many variations on asynchronous tasks in parallel
which is useful when you want to do something like calling an API with a variety
of parameters and validate the results.
Install
Installing RxT is easy. You can install it with one of the following commands (as a testing framework, installing as a dev dependency is recommended):
yarn add --dev rxt
npm i -D rxt
npm install --save-dev rxt
Basic Usage
The below code utilizes should.js
as
the assertion library and tests the capitalize
function from
lodash
. The assertions can easily be done with any
assertion library and the function under test can return any value or can return
any Observable
from RxJS
.
/* ES2015 */; // Assertion Library; // RxT; // Function under test // Setup the test suite;
See the test/
directory for more examples.
Team
Ray Benefield |
Solution Architect |
License
MIT © Ray Benefield