immutable-class-tester
TypeScript icon, indicating that this package has built-in type declarations

0.7.4 • Public • Published

Immutable Class Tester

A little library to facilitate the testing of immutable classes.

This library is really just a set of templates and testing tools to allow for quick construction of immutable classes.

Immutable Class provides one testing function for testing potential immutable classes: testImmutableClass

It is used like so:

testImmutableClass(MyImmutableClassConstructor, [
  { "potential": 1 }
  { "distinct": 2 }
  { "js": 3 }
  { "immutable classes": 4 }
]);

This function will then try to call fromJS on each candidate and run it through a series of tests to ensure that it corresponds to the rules above. It will also do an equality check of every object with every other object and make sure that it only equals itself.

For an example of the usage of this library look at these files: source, tests.

/immutable-class-tester/

    Package Sidebar

    Install

    npm i immutable-class-tester

    Weekly Downloads

    260

    Version

    0.7.4

    License

    Apache-2.0

    Unpacked Size

    33.3 kB

    Total Files

    10

    Last publish

    Collaborators

    • vadimon
    • jgoz