Added javascript unit test for chain