Update test.js

Adding functionality