Skip to content

Commit

Permalink
revert since ava relies on arrow functions anyway, update travis node…
Browse files Browse the repository at this point in the history
… versions
  • Loading branch information
sebastiansandqvist committed Jan 24, 2018
1 parent 0b287d5 commit f89c474
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 43 deletions.
38 changes: 8 additions & 30 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
26 changes: 13 additions & 13 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand All @@ -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));
Expand All @@ -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));
Expand All @@ -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));
Expand All @@ -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));
Expand All @@ -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));
Expand Down

0 comments on commit f89c474

Please sign in to comment.