From 289da7c6f580b81307d6ac845f24e90a71461e15 Mon Sep 17 00:00:00 2001 From: Andreas Lind Date: Thu, 3 Jan 2019 18:41:20 +0100 Subject: [PATCH 1/5] Update unexpected to ^11.0.0-4 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index ebde678..dfc6203 100644 --- a/package.json +++ b/package.json @@ -52,7 +52,7 @@ "rollup-plugin-node-globals": "^1.2.1", "rollup-plugin-node-resolve": "^3.3.0", "rollup-plugin-uglify": "^2.0.1", - "unexpected": "^10.32.0", + "unexpected": "^11.0.0-4", "unexpected-documentation-site-generator": "^4.0.0", "unexpected-markdown": "^1.4.0" } From 5c01d857cc7146ff3054b6b5c13d3e0ab24f601f Mon Sep 17 00:00:00 2001 From: Andreas Lind Date: Thu, 3 Jan 2019 18:45:51 +0100 Subject: [PATCH 2/5] bootstrap-unexpected-markdown: Clone before installing the plugin Also, fix up the test suite so it doesn't rely on bootstrap-unexpected-markdown.js having overridden preferredWidth globally. --- bootstrap-unexpected-markdown.js | 8 ++++++-- test/after.spec.js | 4 ++++ test/before.spec.js | 5 +++++ test/between.spec.js | 6 ++++++ test/close-to.spec.js | 5 +++++ test/equal.spec.js | 5 +++++ 6 files changed, 31 insertions(+), 2 deletions(-) diff --git a/bootstrap-unexpected-markdown.js b/bootstrap-unexpected-markdown.js index a395632..67a9bf1 100644 --- a/bootstrap-unexpected-markdown.js +++ b/bootstrap-unexpected-markdown.js @@ -1,4 +1,8 @@ /*global unexpected:true*/ -unexpected = require('unexpected'); +unexpected = require('unexpected') + .clone() + .use(require('./lib/unexpected-date')); + +// Make sure that error messages are rendered deterministically, +// regardless of the width of the terminal window: unexpected.output.preferredWidth = 80; -unexpected.use(require('./lib/unexpected-date')); diff --git a/test/after.spec.js b/test/after.spec.js index c613fdd..df0f351 100644 --- a/test/after.spec.js +++ b/test/after.spec.js @@ -3,6 +3,10 @@ var unexpected = require('unexpected'), describe('unexpected-date', function() { var expect = unexpected.clone().use(unexpectedDate); + + // Make sure that error messages are rendered deterministically, + // regardless of the width of the terminal window: + expect.output.preferredWidth = 80; var dateA = new Date(2010, 10, 10); var dateB = new Date(2010, 10, 11); diff --git a/test/before.spec.js b/test/before.spec.js index 10dded4..e98eaf0 100644 --- a/test/before.spec.js +++ b/test/before.spec.js @@ -3,6 +3,11 @@ var unexpected = require('unexpected'), describe('unexpected-date', function() { var expect = unexpected.clone().use(unexpectedDate); + + // Make sure that error messages are rendered deterministically, + // regardless of the width of the terminal window: + expect.output.preferredWidth = 80; + var dateA = new Date(2010, 10, 10); var dateB = new Date(2010, 10, 11); diff --git a/test/between.spec.js b/test/between.spec.js index 9558767..723ac5a 100644 --- a/test/between.spec.js +++ b/test/between.spec.js @@ -3,6 +3,12 @@ var unexpected = require('unexpected'), describe('unexpected-date', function() { var expect = unexpected.clone().use(unexpectedDate); + + // Make sure that error messages are rendered deterministically, + // regardless of the width of the terminal window: + expect.output.preferredWidth = 80; + + var dateA = new Date(2010, 10, 10); var dateB = new Date(2010, 10, 11); var dateC = new Date(2010, 10, 12); diff --git a/test/close-to.spec.js b/test/close-to.spec.js index c2bb3da..6f56e20 100644 --- a/test/close-to.spec.js +++ b/test/close-to.spec.js @@ -3,6 +3,11 @@ var unexpected = require('unexpected'), describe('unexpected-date', function() { var expect = unexpected.clone().use(unexpectedDate); + + // Make sure that error messages are rendered deterministically, + // regardless of the width of the terminal window: + expect.output.preferredWidth = 80; + var dateA = new Date(2010, 10, 10); var dateB = new Date(2010, 10, 11); diff --git a/test/equal.spec.js b/test/equal.spec.js index c849bc8..f6b2d9c 100644 --- a/test/equal.spec.js +++ b/test/equal.spec.js @@ -3,6 +3,11 @@ var unexpected = require('unexpected'), describe('unexpected-date', function() { var expect = unexpected.clone().use(unexpectedDate); + + // Make sure that error messages are rendered deterministically, + // regardless of the width of the terminal window: + expect.output.preferredWidth = 80; + var dateA = new Date(2010, 10, 10); var dateB = new Date(2010, 10, 11); From 5d84358effbe2ccac60ca76653a21f40fdb32001 Mon Sep 17 00:00:00 2001 From: Andreas Lind Date: Thu, 3 Jan 2019 18:47:16 +0100 Subject: [PATCH 3/5] Use mocha --require instead of --compilers This avoids a deprecation warning if mocha is upgraded at a later point. --- test/mocha.opts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/mocha.opts b/test/mocha.opts index 8a9990d..cb95a2f 100644 --- a/test/mocha.opts +++ b/test/mocha.opts @@ -2,4 +2,4 @@ --recursive --check-leaks --require ./bootstrap-unexpected-markdown.js ---compilers md:unexpected-markdown +--require unexpected-markdown From 9a69ff15f08747cb1f19b54e382213c78be3942b Mon Sep 17 00:00:00 2001 From: Andreas Lind Date: Thu, 3 Jan 2019 19:12:42 +0100 Subject: [PATCH 4/5] Add .npmrc to disable package-lock and save-exact --- .npmrc | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 .npmrc diff --git a/.npmrc b/.npmrc new file mode 100644 index 0000000..a41c857 --- /dev/null +++ b/.npmrc @@ -0,0 +1,2 @@ +package-lock = false +save-exact = false From c89fd0d90926a3fb011fcf6c5adf20c1690b2395 Mon Sep 17 00:00:00 2001 From: Sushant Date: Fri, 4 Jan 2019 12:13:55 +0530 Subject: [PATCH 5/5] ci: run travis for Node >= 6 --- .travis.yml | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/.travis.yml b/.travis.yml index 7ed3473..ec9a661 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,20 +5,11 @@ language: node_js matrix: include: - - node_js: "0.10" - env: LINT=0 - - node_js: "0.12" - env: LINT=0 - - node_js: "4" - env: LINT=1 - - node_js: "5" - env: LINT=1 - node_js: "6" - env: LINT=1 - node_js: "7" - env: LINT=1 - node_js: "8" - env: LINT=1 + - node_js: "9" + - node_js: "10" cache: directories: @@ -28,5 +19,5 @@ notifications: email: false script: - - if [ "$LINT" = "1" ]; then npm run lint; fi + - npm run lint - npm run travis