From 0b287d5851607700b3f909047597e3dc6e787be0 Mon Sep 17 00:00:00 2001 From: Sebastian Sandqvist Date: Wed, 24 Jan 2018 10:44:10 -0800 Subject: [PATCH] support old node versions in tests --- .../33f700761be86b049d03b940d62e63e5.json | 1 + .../a717db2daaec45050d0d6d8b93ffd4b3.json | 1 + coverage/lcov-report/index.html | 2 +- coverage/lcov-report/index.js.html | 2 +- package.json | 5 +--- test/test.js | 26 +++++++++---------- 6 files changed, 18 insertions(+), 19 deletions(-) create mode 100644 .nyc_output/33f700761be86b049d03b940d62e63e5.json create mode 100644 .nyc_output/a717db2daaec45050d0d6d8b93ffd4b3.json diff --git a/.nyc_output/33f700761be86b049d03b940d62e63e5.json b/.nyc_output/33f700761be86b049d03b940d62e63e5.json new file mode 100644 index 0000000..9e26dfe --- /dev/null +++ b/.nyc_output/33f700761be86b049d03b940d62e63e5.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/.nyc_output/a717db2daaec45050d0d6d8b93ffd4b3.json b/.nyc_output/a717db2daaec45050d0d6d8b93ffd4b3.json new file mode 100644 index 0000000..02a6f4f --- /dev/null +++ b/.nyc_output/a717db2daaec45050d0d6d8b93ffd4b3.json @@ -0,0 +1 @@ +{"/home/seb/Code/s-ago/index.js":{"path":"/home/seb/Code/s-ago/index.js","statementMap":{"0":{"start":{"line":18,"column":12},"end":{"line":18,"column":38}},"1":{"start":{"line":19,"column":2},"end":{"line":19,"column":54}},"2":{"start":{"line":24,"column":13},"end":{"line":24,"column":50}},"3":{"start":{"line":25,"column":14},"end":{"line":25,"column":23}},"4":{"start":{"line":27,"column":2},"end":{"line":29,"column":3}},"5":{"start":{"line":28,"column":4},"end":{"line":28,"column":22}},"6":{"start":{"line":31,"column":2},"end":{"line":35,"column":3}},"7":{"start":{"line":32,"column":4},"end":{"line":34,"column":5}},"8":{"start":{"line":33,"column":6},"end":{"line":33,"column":72}},"9":{"start":{"line":39,"column":0},"end":{"line":46,"column":2}},"10":{"start":{"line":48,"column":0},"end":{"line":48,"column":21}}},"fnMap":{"0":{"name":"format","decl":{"start":{"line":17,"column":9},"end":{"line":17,"column":15}},"loc":{"start":{"line":17,"column":43},"end":{"line":20,"column":1}},"line":17},"1":{"name":"ago","decl":{"start":{"line":22,"column":9},"end":{"line":22,"column":12}},"loc":{"start":{"line":22,"column":19},"end":{"line":37,"column":1}},"line":22}},"branchMap":{"0":{"loc":{"start":{"line":19,"column":9},"end":{"line":19,"column":53}},"type":"cond-expr","locations":[{"start":{"line":19,"column":20},"end":{"line":19,"column":24}},{"start":{"line":19,"column":27},"end":{"line":19,"column":53}}],"line":19},"1":{"loc":{"start":{"line":27,"column":2},"end":{"line":29,"column":3}},"type":"if","locations":[{"start":{"line":27,"column":2},"end":{"line":29,"column":3}},{"start":{"line":27,"column":2},"end":{"line":29,"column":3}}],"line":27},"2":{"loc":{"start":{"line":32,"column":4},"end":{"line":34,"column":5}},"type":"if","locations":[{"start":{"line":32,"column":4},"end":{"line":34,"column":5}},{"start":{"line":32,"column":4},"end":{"line":34,"column":5}}],"line":32}},"s":{"0":31,"1":31,"2":32,"3":32,"4":32,"5":1,"6":31,"7":109,"8":31,"9":1,"10":1},"f":{"0":31,"1":32},"b":{"0":[15,16],"1":[1,31],"2":[31,78]},"_coverageSchema":"332fd63041d2c1bcb487cc26dd0d5f7d97098a6c","hash":"d09cc7963c40d24e16684f358ce00502bfef20c4","contentHash":"e544641a98add0e5cf09a920715aebc7_11.4.1"}} \ No newline at end of file diff --git a/coverage/lcov-report/index.html b/coverage/lcov-report/index.html index e6d8946..786b106 100644 --- a/coverage/lcov-report/index.html +++ b/coverage/lcov-report/index.html @@ -77,7 +77,7 @@

diff --git a/coverage/lcov-report/index.js.html b/coverage/lcov-report/index.js.html index cf7fefc..bab9ebb 100644 --- a/coverage/lcov-report/index.js.html +++ b/coverage/lcov-report/index.js.html @@ -193,7 +193,7 @@

diff --git a/package.json b/package.json index 5c6d451..1c29757 100644 --- a/package.json +++ b/package.json @@ -8,10 +8,7 @@ }, "scripts": { "coverage": "nyc --reporter=lcov --reporter=text ava", - "lint": "eslint index.js -c etc/.eslint.json", - "postlint": "npm run coverage", - "test": "ava", - "posttest": "npm run lint" + "test": "ava" }, "repository": { "type": "git", diff --git a/test/test.js b/test/test.js index 8400e13..6e7644b 100644 --- a/test/test.js +++ b/test/test.js @@ -3,18 +3,18 @@ import ago from '../'; const timestamp = new Date(); -test('just now', (t) => { +test('just now', function(t) { t.is(ago(timestamp), 'just now'); }); -test('minute', (t) => { +test('minute', function(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', (t) => { +test('minutes', function(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', (t) => { t.is(ago(minutes3), '45 minutes ago'); }); -test('hour', (t) => { +test('hour', function(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', (t) => { t.is(ago(hourPlus), 'an hour ago'); }); -test('hours', (t) => { +test('hours', function(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', (t) => { t.is(ago(hours3), '19 hours ago'); }); -test('yesterday', (t) => { +test('yesterday', function(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', (t) => { t.is(ago(yesterday3), 'yesterday'); }); -test('days', (t) => { +test('days', function(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', (t) => { +test('week', function(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', (t) => { +test('weeks', function(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', (t) => { +test('month', function(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', (t) => { t.is(ago(month3), 'last month'); }); -test('months', (t) => { +test('months', function(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', (t) => { +test('year', function(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', (t) => { +test('years', function(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));