checking for window in test and dist release