From 1dd7aad1e813f7f228a97886bc547913a40dd085 Mon Sep 17 00:00:00 2001 From: Richard Schneider Date: Thu, 1 Feb 2018 13:49:39 +1300 Subject: [PATCH 1/3] test: add shutdown test --- js/src/miscellaneous.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/js/src/miscellaneous.js b/js/src/miscellaneous.js index 7a7d60c9..e3e676d3 100644 --- a/js/src/miscellaneous.js +++ b/js/src/miscellaneous.js @@ -81,5 +81,18 @@ module.exports = (common) => { expect(res).to.exist() }) }) + + it('.shutdown support', (done) => { // must be last test to run + // go-ipfs returns an error, https://github.com/ipfs/go-ipfs/issues/4078 + ipfs.shutdown((err) => { + if (err && err.message != 'read ECONNRESET') { + expect(err).to.not.exist() + } + ipfs.shutdown((err) => { + expect(err).to.exist() + done() + }) + }) + }) }) } From c5e2216f5daa4589cd4b9e9771d0fc6988ef1db9 Mon Sep 17 00:00:00 2001 From: Richard Schneider Date: Thu, 1 Feb 2018 13:51:14 +1300 Subject: [PATCH 2/3] test: lint --- js/src/miscellaneous.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/src/miscellaneous.js b/js/src/miscellaneous.js index e3e676d3..0cda67ee 100644 --- a/js/src/miscellaneous.js +++ b/js/src/miscellaneous.js @@ -81,7 +81,7 @@ module.exports = (common) => { expect(res).to.exist() }) }) - + it('.shutdown support', (done) => { // must be last test to run // go-ipfs returns an error, https://github.com/ipfs/go-ipfs/issues/4078 ipfs.shutdown((err) => { From 7655ad559242fc5ac8dba0363f947afc5def594f Mon Sep 17 00:00:00 2001 From: David Dias Date: Fri, 2 Feb 2018 00:57:03 -0800 Subject: [PATCH 3/3] add TODO --- js/src/miscellaneous.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/src/miscellaneous.js b/js/src/miscellaneous.js index 0cda67ee..fe703d10 100644 --- a/js/src/miscellaneous.js +++ b/js/src/miscellaneous.js @@ -83,9 +83,9 @@ module.exports = (common) => { }) it('.shutdown support', (done) => { // must be last test to run - // go-ipfs returns an error, https://github.com/ipfs/go-ipfs/issues/4078 + // TODO: go-ipfs returns an error, https://github.com/ipfs/go-ipfs/issues/4078 ipfs.shutdown((err) => { - if (err && err.message != 'read ECONNRESET') { + if (err && err.message !== 'read ECONNRESET') { expect(err).to.not.exist() } ipfs.shutdown((err) => {