From f89c47487b6bb7f77dd084f525e6c05f35789d6b Mon Sep 17 00:00:00 2001 From: Sebastian Sandqvist Date: Wed, 24 Jan 2018 10:51:07 -0800 Subject: [PATCH] revert since ava relies on arrow functions anyway, update travis node versions --- .travis.yml | 38 ++++++++------------------------------ test/test.js | 26 +++++++++++++------------- 2 files changed, 21 insertions(+), 43 deletions(-) diff --git a/.travis.yml b/.travis.yml index 7201848..000d047 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,36 +1,14 @@ language: node_js node_js: - - "7.0" - - "6.0" - - "5.0" - - "4.0" - - "iojs-v3.3" - - "iojs-v3.0" - - "iojs-v2.5" - - "iojs-v2.0" - - "iojs-v1.8" - - "iojs-v1.0" - - "0.12" - - "0.11" - - "0.10" - - "0.9" - - "0.8" - - "0.6" - - "0.4" + - "node" + - "lts/*" + - "9" + - "8" + - "7" + - "6" + - "5" + - "4" sudo: false -matrix: - allow_failures: - - node_js: "iojs-v2.5" - - node_js: "iojs-v2.0" - - node_js: "iojs-v1.8" - - node_js: "iojs-v1.0" - - node_js: "0.12" - - node_js: "0.11" - - node_js: "0.10" - - node_js: "0.9" - - node_js: "0.8" - - node_js: "0.6" - - node_js: "0.4" addons: code_climate: repo_token: c93da2cf072402fbbe53d73c3b136f50e3d337125b6f4b1c056881adab818d2e diff --git a/test/test.js b/test/test.js index 6e7644b..8400e13 100644 --- a/test/test.js +++ b/test/test.js @@ -3,18 +3,18 @@ import ago from '../'; const timestamp = new Date(); -test('just now', function(t) { +test('just now', (t) => { t.is(ago(timestamp), 'just now'); }); -test('minute', function(t) { +test('minute', (t) => { const minute = new Date(timestamp - (60 * 1000)); const minute2 = new Date(timestamp - ((60 * 1000) + 5000)); t.is(ago(minute), 'a minute ago'); t.is(ago(minute2), 'a minute ago'); }); -test('minutes', function(t) { +test('minutes', (t) => { const minutes = new Date(timestamp - (2 * 60 * 1000)); const minutes2 = new Date(timestamp - (20 * 60 * 1000)); const minutes3 = new Date(timestamp - (45 * 60 * 1000)); @@ -23,7 +23,7 @@ test('minutes', function(t) { t.is(ago(minutes3), '45 minutes ago'); }); -test('hour', function(t) { +test('hour', (t) => { const underHour = new Date(timestamp - (50 * 60 * 1000)); const hour = new Date(timestamp - (60 * 60 * 1000)); const hourPlus = new Date(timestamp - (90 * 60 * 1000)); @@ -32,7 +32,7 @@ test('hour', function(t) { t.is(ago(hourPlus), 'an hour ago'); }); -test('hours', function(t) { +test('hours', (t) => { const hours = new Date(timestamp - (2 * 60 * 60 * 1000)); const hours2 = new Date(timestamp - (3.5 * 60 * 60 * 1000)); const hours3 = new Date(timestamp - (19 * 60 * 60 * 1000)); @@ -41,7 +41,7 @@ test('hours', function(t) { t.is(ago(hours3), '19 hours ago'); }); -test('yesterday', function(t) { +test('yesterday', (t) => { const yesterday = new Date(timestamp - (20 * 60 * 60 * 1000)); const yesterday2 = new Date(timestamp - (40 * 60 * 60 * 1000)); const yesterday3 = new Date(timestamp - (47 * 60 * 60 * 1000)); @@ -50,28 +50,28 @@ test('yesterday', function(t) { t.is(ago(yesterday3), 'yesterday'); }); -test('days', function(t) { +test('days', (t) => { const days = new Date(timestamp - (2 * 24 * 60 * 60 * 1000)); const days2 = new Date(timestamp - (5 * 24 * 60 * 60 * 1000)); t.is(ago(days), '2 days ago'); t.is(ago(days2), '5 days ago'); }); -test('week', function(t) { +test('week', (t) => { const week = new Date(timestamp - (6 * 24 * 60 * 60 * 1000)); const week2 = new Date(timestamp - (13 * 24 * 60 * 60 * 1000)); t.is(ago(week), 'last week'); t.is(ago(week2), 'last week'); }); -test('weeks', function(t) { +test('weeks', (t) => { const weeks = new Date(timestamp - (2 * 7 * 24 * 60 * 60 * 1000)); const weeks2 = new Date(timestamp - (3 * 7 * 24 * 60 * 60 * 1000)); t.is(ago(weeks), '2 weeks ago'); t.is(ago(weeks2), '3 weeks ago'); }); -test('month', function(t) { +test('month', (t) => { const month = new Date(timestamp - (4 * 7 * 24 * 60 * 60 * 1000)); const month2 = new Date(timestamp - (30 * 24 * 60 * 60 * 1000)); const month3 = new Date(timestamp - (50 * 24 * 60 * 60 * 1000)); @@ -80,21 +80,21 @@ test('month', function(t) { t.is(ago(month3), 'last month'); }); -test('months', function(t) { +test('months', (t) => { const months = new Date(timestamp - (2 * 30 * 24 * 60 * 60 * 1000)); const months2 = new Date(timestamp - (10 * 30 * 24 * 60 * 60 * 1000)); t.is(ago(months), '2 months ago'); t.is(ago(months2), '10 months ago'); }); -test('year', function(t) { +test('year', (t) => { const year = new Date(timestamp - (350 * 24 * 60 * 60 * 1000)); const year2 = new Date(timestamp - (1.5 * 360 * 24 * 60 * 60 * 1000)); t.is(ago(year), 'last year'); t.is(ago(year2), 'last year'); }); -test('years', function(t) { +test('years', (t) => { const years = new Date(timestamp - (2 * 365 * 24 * 60 * 60 * 1000)); const years2 = new Date(timestamp - (20 * 365 * 24 * 60 * 60 * 1000)); const years3 = new Date(timestamp - (100 * 365 * 24 * 60 * 60 * 1000));