New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

rxt

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rxt

A declarative testing framework.

latest
Source
npmnpm
Version
0.2.5
Version published
Maintainers
1
Created
Source

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 */
import 'should';                              // Assertion Library
import describe from 'rxt';                   // RxT
import capitalize from 'lodash/capitalize';   // Function under test

// Setup the test suite
describe('My Code Under Test', (it) => {

    // Individual test
    it('should capitalize hello', example => example
        .given(
            'hello'                           // Parameter for function
        )
        .when(value =>
            capitalize(value)                 // Function under test
        )
        .then(result =>
            result.should.be.exactly('Hello') // Assertion of result
        )
    );

});

See the test/ directory for more examples.

Team

Ray Benefield
Ray Benefield
Solution Architect

License

MIT © Ray Benefield

FAQs

Package last updated on 13 May 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts