[Pkg-javascript-commits] [node-tap] 50/186: snapshots: better error when failing, add .js extension

Bastien Roucariès rouca at moszumanska.debian.org
Fri Dec 1 16:40:42 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 7d4d8685411fa810e5070400c49dca9e2d1966ba
Author: isaacs <i at izs.me>
Date:   Tue Oct 31 11:31:27 2017 -0700

    snapshots: better error when failing, add .js extension
---
 lib/snapshot.js | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/lib/snapshot.js b/lib/snapshot.js
index 6fed645..c3455f6 100644
--- a/lib/snapshot.js
+++ b/lib/snapshot.js
@@ -13,7 +13,7 @@ class Snapshot {
       process.cwd(),
       'tap-snapshots',
       this.test.fullname.replace(/[^a-zA-Z0-9\._\-]+/g, '-')
-    )
+    ) + '.js'
     this.snapshot = null
   }
 
@@ -25,9 +25,11 @@ class Snapshot {
     try {
       this.snapshot = this.snapshot || require(this.file)
     } catch (er) {
-      throw new Error('Snapshot file not found\n' +
-                      'Run with TAP_SNAPSHOT=1 in the environment\n' +
-                      'to create snapshot files')
+      throw new Error(
+        'Snapshot file not found: ' + this.file + '\n' +
+        'Run with TAP_SNAPSHOT=1 in the environment\n' +
+        'to create snapshot files'
+      )
     }
     return this.snapshot[message + '_' + index] === data
   }

-- 
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