Make tests work in Node or browser