format test.js and cache test var