@organicdesign/crdt-tests
v0.4.1
Published
Tests for CRDTs implementing crdt-interfaces.
Downloads
25
Readme
crdt-tests
Tests for CRDTs implementing @organicdesign/crdt-interfaces
.
Table of Contents
Install
npm i --save-dev @organicdesign/crdt-tests
Usage
To use a test you just need to import the relevant test method and call it on a CRDT implementation. If you are testing against a specific CRDT (for example G-Counter) then you do not need to test against the general CRDT tests since those are included in the specific tests. The general tests are to assist with the creation of abitrary CRDTs that may not have a specific test ready for them.
Most of these tests are created for implementations that use arbitrary data types, if the implementation is for a specific data type then a specific test should also be created for it.
Tests
CRDT
import { createCRDTTest } from "@organicdesign/crdt-tests";
This test is a general CRDT test for CRDTs conforming to the CRDT interface. This will check that functionality of it works.
Sync
import { createSyncronizeTest } from "@organicdesign/crdt-tests";
This test checks that the synchronization functionality of a CRDT works.
Broadcast
import { createBroadcastTest } from "@organicdesign/crdt-tests";
This test checks that the broadcast functionality of a CRDT works, given that the CRDT implements this optional feature.
Serialize
import { createSerializeTest } from "@organicdesign/crdt-tests";
This test checks the the serialization functionality of a CRDT works give that the CRDT implements this optional feature.
G-Counter
Status: Basic
import { createGCounterTest } from "@organicdesign/crdt-tests";
This test is for a G-Counter CRDT that implements the CRDT & MCounter interfaces.
PN-Counter
Status: Basic
import { createPNCounterTest } from "@organicdesign/crdt-tests";
This test is for a PN-Counter CRDT that implements the CRDT & BCounter interfaces.
G-Set
Status: Incomplete
import { createGSetTest } from "@organicdesign/crdt-tests";
This test is for a G-Set CRDT that implements the CRDT & MSet interfaces.
MV-Register
Status: Incomplete
import { createMVRegisterTest } from "@organicdesign/crdt-tests";
This test is for a MV-Register CRDT that implements the CRDT & MVRegister interfaces.
LWW-Register
Status: Incomplete
import { createLWWRegisterTest } from "@organicdesign/crdt-tests";
This test is for a LWW-Register CRDT that implements the CRDT & BRegister interfaces.
LWW-Map
Status: Incomplete
import { createLWWMapTest } from "@organicdesign/crdt-tests";
This test is for a LWW-Map CRDT that implements the CRDT & BMap interfaces.
CRDT-Map
Status: Incomplete
import { createLWWMapTest } from "@organicdesign/crdt-tests";
This test is for a CRDT-Map CRDT that implements the CRDT & MMap interfaces.
To-Do
This package contains basic testing systems for CRDTs but there probably are better ways to setup the tests (espicially after the interfaces version 4.0.0 change), contribution would be most welcome to improve these tests.
Module tests:
- [ ] Synchronizer tests.
- [ ] Serializer tests.
- [ ] Broadcaster tests.
Type tests:
- [ ] MV-Register register specific methods tests.
- [ ] G-Set set specific methods tests.
- [ ] LWW-Register register specific methods tests.
- [ ] LWW-Map map specific methods tests.
- [ ] CRDT-Map map specific methods tests.
- [ ] MV-Register type specific tests.
- [ ] G-Counter type specific tests.
- [ ] PN-Counter type specific tests.
- [ ] G-Set type specific tests.
- [ ] LWW-Register type specific tests.
- [ ] LWW-Map type specific tests.
- [ ] CRDT-Map type specific tests.
Other:
- [ ] Custom logger.