add the testFunc.js

move all the test functions to  js file