Socket
Socket
Sign inDemoInstall

immutable-class-tester

Package Overview
Dependencies
25
Maintainers
3
Versions
17
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    immutable-class-tester

A helper for testing immutable classes


Version published
Weekly downloads
405
increased by191.37%
Maintainers
3
Install size
368 kB
Created
Weekly downloads
 

Readme

Source

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.

Keywords

FAQs

Last updated on 03 Feb 2022

Did you know?

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc