Make test.js can be used directly
Tweak code style