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

Commit ef1a8e2

Browse files
committed
Fix errors on node <= 5
1 parent 7820f16 commit ef1a8e2

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ node_js:
55
- 6
66

77
cache:
8+
yarn: true
89
directories:
910
- node_modules
1011

test/unit/formatErrors.spec.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@ const formatErrors = require('../../src/core/formatErrors');
22
const expect = require('expect');
33

44
const simple = (errors) => errors
5-
.filter(({ type }) => !type).map(({ message }) => message);
5+
.filter(error => !error.type).map(e => e.message);
66

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

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

1313
const formatters = [allCaps];
1414

0 commit comments

Comments
 (0)