[Pkg-javascript-commits] [node-tap] 97/186: ignore nonexistent files (bwcomp)

Bastien Roucariès rouca at moszumanska.debian.org
Fri Dec 1 16:40:48 UTC 2017


This is an automated email from the git hooks/post-receive script.

rouca pushed a commit to branch master
in repository node-tap.

commit 00d98e28a0d93737450a735774ff3ac82dfe56d8
Author: isaacs <i at izs.me>
Date:   Sat Nov 18 22:18:57 2017 -0800

    ignore nonexistent files (bwcomp)
---
 bin/run.js  | 8 +++++++-
 test/run.js | 2 +-
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/bin/run.js b/bin/run.js
index c316491..8be0c6a 100755
--- a/bin/run.js
+++ b/bin/run.js
@@ -710,7 +710,13 @@ const runAllFiles = (options, saved, tap) => {
       continue
     }
 
-    const st = fs.statSync(options.files[i])
+    let st
+    try {
+      st = fs.statSync(file)
+    } catch (er) {
+      continue
+    }
+
     if (options.timeout)
       opt.timeout = options.timeout * 1000
 
diff --git a/test/run.js b/test/run.js
index 054e11b..1bf1245 100644
--- a/test/run.js
+++ b/test/run.js
@@ -95,7 +95,7 @@ t.test('usage and other basics', t => {
 
 t.test('basic', t => {
   const ok = tmpfile(t, 'ok.js', `require(${tap}).pass('this is fine')`)
-  run(['-Cbt0', '--', ok], null, (err, stdout, stderr) => {
+  run(['-Cbt0', '--', 'doesnt exist', ok], null, (err, stdout, stderr) => {
     t.matchSnapshot(clean(stdout), 'ok.js output')
     t.end()
   })

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-tap.git



More information about the Pkg-javascript-commits mailing list