made testing environment work for browser and node