Refactoring tests to ES6