Update tests.js

adding unit tests