added tests for js using qunit and implemented the passing solution