npm.nicfv.com

    Module t6 - v1.2.1

    Lightweight assertion testing framework

    NPM Downloads NPM Last Update

    If T6 is only used during the testing phase of development, it can be installed as a devDependency instead of a dependency. The difference here is that when you pack up your package, or when other people install your package, it will contain all dependencies, but no devDependencies. To install T6 as a devDependency, use the following command in your project directory.

    npm i -D t6
    

    T6 contains a simple, lightweight assertion testing framework for JavaScript and TypeScript projects. If any one of the T6 tests fail, it will throw an exception and halt program execution. Exceptions can be caught using the standard try ... catch block. To import the entire testing suite, use the following import line.

    import * as T6 from 't6';
    

    T6 exports a library of functions that includes several different test types, all of which can be simply derived from T6.isTrue(...). Each test type throws a unique exception message if failed. Custom exception messages are optional, but always recommended for clarity to explain why a test may have failed.

    Documents

    CHANGELOG
    Examples/Assert Boolean Values
    Examples/Catching Exceptions
    Examples/Custom Exception Message
    Examples/Numeric Comparisons

    Functions

    eq
    ge
    getTestNumber
    gt
    is
    isFalse
    isTrue
    le
    lt
    ne
    not
    MMNEPVFCICPMFPCPTTAAATR