From d2545b1447a1155ffc57796651d93989c5a4597f Mon Sep 17 00:00:00 2001 From: Benjamin Young Date: Tue, 28 Jan 2020 15:03:51 -0500 Subject: [PATCH 1/7] Make tests work on Windows And hopefully they still work for everyon else... ;) --- .gitignore | 2 ++ test/import_spec.js | 7 ++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index e3b0138..91c6bbb 100644 --- a/.gitignore +++ b/.gitignore @@ -21,3 +21,5 @@ bower_components db/ package-lock.json + +import_test_db_0123 diff --git a/test/import_spec.js b/test/import_spec.js index 253db47..8557918 100644 --- a/test/import_spec.js +++ b/test/import_spec.js @@ -14,7 +14,7 @@ describe("CLI: import n3 file(s)", function() { , import_stderr; before(function(done) { - exec('./import.js -q ' + test_file_path + ' -o ' + test_db_path, + exec('node import.js -q ' + test_file_path + ' -o ' + test_db_path, function (err, stdout, stderr) { import_err = err; import_stdout = stdout; @@ -24,9 +24,10 @@ describe("CLI: import n3 file(s)", function() { }); after(function(done) { - exec('rm -r import_test_db_0123', - function (err, stdout, stderr) { + fs.rmdir('import_test_db_0123', {recursive: true}, + function (err) { if (err) return done(err); + console.log('import_test_db_0123 removed'); done(); }); }); From e935deb3f29fdc5e1e72ed936a69e97c4022d93d Mon Sep 17 00:00:00 2001 From: Benjamin Young Date: Tue, 28 Jan 2020 16:50:08 -0500 Subject: [PATCH 2/7] Upgrade level & devDeps; switch to nyc --- .gitignore | 1 + package.json | 13 +++++-------- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/.gitignore b/.gitignore index 91c6bbb..bb5a78e 100644 --- a/.gitignore +++ b/.gitignore @@ -22,4 +22,5 @@ bower_components db/ package-lock.json +.nyc_output/ import_test_db_0123 diff --git a/package.json b/package.json index 2a0ab25..ee06c2e 100644 --- a/package.json +++ b/package.json @@ -5,9 +5,7 @@ "main": "index.js", "scripts": { "test": "mocha --reporter spec test", - "zuul": "zuul test/common.js test/*spec.js", - "zuul-local": "zuul --open --local 8080 -- test/common.js test/*spec.js", - "coverage": "rm -rf coverage; istanbul cover _mocha -- --recursive --reporter spec --bail", + "coverage": "nyc --reporter=lcov npm run test", "publish-coverage": "cat coverage/lcov.info | coveralls" }, "repository": { @@ -34,7 +32,7 @@ "concat-stream": "^1.6.0", "end-of-stream": "^1.4.0", "glob": "^7.1.2", - "level": "^1.7.0", + "level": "^6.0.0", "mkdirp": "^0.5.0", "n3": "^0.10.0", "progress-stream": "^2.0.0", @@ -44,14 +42,13 @@ "levelgraph": "^2.0.0" }, "devDependencies": { - "browserify": "^14.3.0", + "browserify": "^16.5.0", "chai": "^3.5.0", "coveralls": "^2.13.1", - "istanbul": "^0.4.4", + "nyc": "^15.0.0", "levelgraph": "^2.0.0", "memdb": "^1.3.1", "mocha": "^3.4.2", - "uglify-js": "^3.0.15", - "zuul": "^3.11.1" + "uglify-js": "^3.0.15" } } From 425429a0abc7887377be652b083eb62d8776ed9c Mon Sep 17 00:00:00 2001 From: Benjamin Young Date: Wed, 29 Jan 2020 09:20:59 -0500 Subject: [PATCH 3/7] Upgrade chai, mocha, & coveralls Fixes all remaining vulnerabilities--mostly that was coveralls. --- package.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index ee06c2e..ff7ea02 100644 --- a/package.json +++ b/package.json @@ -43,12 +43,12 @@ }, "devDependencies": { "browserify": "^16.5.0", - "chai": "^3.5.0", - "coveralls": "^2.13.1", + "chai": "^4.2.0", + "coveralls": "^3.0.9", "nyc": "^15.0.0", "levelgraph": "^2.0.0", "memdb": "^1.3.1", - "mocha": "^3.4.2", + "mocha": "^7.0.1", "uglify-js": "^3.0.15" } } From c29aca5a8feb7af81719044ca3b1af970636a7db Mon Sep 17 00:00:00 2001 From: Benjamin Young Date: Wed, 29 Jan 2020 10:25:35 -0500 Subject: [PATCH 4/7] Update list of Node versions for Travis --- .travis.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 1f4d8dd..f5fd108 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,9 +1,10 @@ language: node_js node_js: - - "4" - - "6" - - "7" - "8" + - "10" # LTS + - "11" + - "12" # LTS + - "13" script: - npm run coverage - npm run publish-coverage From 1eacf19ceadd7965bff67ce71860ee61ab3f7c80 Mon Sep 17 00:00:00 2001 From: Benjamin Young Date: Wed, 29 Jan 2020 15:35:43 -0500 Subject: [PATCH 5/7] Deal with fs.rmdir function sig changes --- test/import_spec.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/test/import_spec.js b/test/import_spec.js index 8557918..3c4ed2b 100644 --- a/test/import_spec.js +++ b/test/import_spec.js @@ -24,12 +24,17 @@ describe("CLI: import n3 file(s)", function() { }); after(function(done) { - fs.rmdir('import_test_db_0123', {recursive: true}, - function (err) { + let callback = function (err) { if (err) return done(err); console.log('import_test_db_0123 removed'); done(); - }); + }; + // deal with fs.rmdir function signature changes... + if (Number(process.version.match(/v([0-9]+)/)[1]) < 12) { + fs.rmdir('import_test_db_0123', callback); + } else { + fs.rmdir('import_test_db_0123', {recursive: true}, callback); + } }); it("should not produce errors or output during quiet import", function() { From f48d9db7a20c45ee479d602dcdaaaaadb46943ce Mon Sep 17 00:00:00 2001 From: Benjamin Young Date: Wed, 29 Jan 2020 16:06:15 -0500 Subject: [PATCH 6/7] Use rimraf to deal with dir cleanup So much simpler to hand this off to a dedicated library... --- package.json | 3 ++- test/import_spec.js | 13 ++++--------- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/package.json b/package.json index ff7ea02..de2dafd 100644 --- a/package.json +++ b/package.json @@ -45,10 +45,11 @@ "browserify": "^16.5.0", "chai": "^4.2.0", "coveralls": "^3.0.9", - "nyc": "^15.0.0", "levelgraph": "^2.0.0", "memdb": "^1.3.1", "mocha": "^7.0.1", + "nyc": "^15.0.0", + "rimraf": "^3.0.1", "uglify-js": "^3.0.15" } } diff --git a/test/import_spec.js b/test/import_spec.js index 3c4ed2b..d7efd34 100644 --- a/test/import_spec.js +++ b/test/import_spec.js @@ -2,7 +2,8 @@ var exec = require('child_process').exec , fs = require('fs') , graph = require('levelgraph') , level = require('level') - , n3 = require('../'); + , n3 = require('../') + , rimraf = require('rimraf'); describe("CLI: import n3 file(s)", function() { @@ -24,17 +25,11 @@ describe("CLI: import n3 file(s)", function() { }); after(function(done) { - let callback = function (err) { + rimraf('import_test_db_0123', function (err) { if (err) return done(err); console.log('import_test_db_0123 removed'); done(); - }; - // deal with fs.rmdir function signature changes... - if (Number(process.version.match(/v([0-9]+)/)[1]) < 12) { - fs.rmdir('import_test_db_0123', callback); - } else { - fs.rmdir('import_test_db_0123', {recursive: true}, callback); - } + }); }); it("should not produce errors or output during quiet import", function() { From 1f6127f0305678bcdf40889ac965f932f84875af Mon Sep 17 00:00:00 2001 From: Benjamin Young Date: Wed, 29 Jan 2020 16:12:20 -0500 Subject: [PATCH 7/7] Upgrade concat-stream, mkdirp, & readable-stream --- package.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index de2dafd..4f67bfd 100644 --- a/package.json +++ b/package.json @@ -29,14 +29,14 @@ "license": "MIT", "dependencies": { "cli": "^1.0.1", - "concat-stream": "^1.6.0", + "concat-stream": "^2.0.0", "end-of-stream": "^1.4.0", "glob": "^7.1.2", "level": "^6.0.0", - "mkdirp": "^0.5.0", + "mkdirp": "^1.0.3", "n3": "^0.10.0", "progress-stream": "^2.0.0", - "readable-stream": "^2.2.10" + "readable-stream": "^3.5.0" }, "peerDependencies": { "levelgraph": "^2.0.0"