seperated js file for browser test
Added check for window in test