Skip to content
This repository has been archived by the owner on Jul 27, 2021. It is now read-only.

Commit

Permalink
Fix errors on node <= 5
Browse files Browse the repository at this point in the history
  • Loading branch information
geowarin committed Jan 16, 2017
1 parent 7820f16 commit ef1a8e2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ node_js:
- 6

cache:
yarn: true
directories:
- node_modules

Expand Down
6 changes: 3 additions & 3 deletions test/unit/formatErrors.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ const formatErrors = require('../../src/core/formatErrors');
const expect = require('expect');

const simple = (errors) => errors
.filter(({ type }) => !type).map(({ message }) => message);
.filter(error => !error.type).map(e => e.message);

const allCaps = (errors) => errors
.filter(({ type }) => type == 'other').map((e) => e.message.toUpperCase());
.filter(error => error.type == 'other').map(e => e.message.toUpperCase());

const notFound = (errors) => errors
.filter(({ type }) => type === 'not-found').map(() => 'Not found');
.filter(error => error.type === 'not-found').map(() => 'Not found');

const formatters = [allCaps];

Expand Down

0 comments on commit ef1a8e2

Please sign in to comment.