[Pkg-javascript-commits] [node-unicode-tr51] 03/03: Adapt Bastien Roucaries' runtestsuite for the mocha test
Julien Puydt
julien.puydt at laposte.net
Thu Aug 24 20:02:24 UTC 2017
This is an automated email from the git hooks/post-receive script.
jpuydt-guest pushed a commit to branch master
in repository node-unicode-tr51.
commit c173cb60dba7181cc7dceeb37c78e753fc5aa9f1
Author: Julien Puydt <julien.puydt at laposte.net>
Date: Thu Aug 24 18:15:48 2017 +0200
Adapt Bastien Roucaries' runtestsuite for the mocha test
---
debian/tests/mocha | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/debian/tests/mocha b/debian/tests/mocha
index 3567292..850c1a3 100644
--- a/debian/tests/mocha
+++ b/debian/tests/mocha
@@ -1,3 +1,15 @@
#!/bin/sh
set -e
-mocha tests/tests.js
+# notice the / at end in order to load this module
+PACKAGE='unicode-tr51'
+SEDCMD1="s,require\s*[(]\s*[\"][.][.]/unicode-tr51[\"'],require(\"$PACKAGE/\",g"
+SEDCMD2="s,require\s*[(]\s*[\"'][.][.][\"'],require('$PACKAGE',g"
+
+tmpdir=$(mktemp -d)
+trap 'rm -rf "$tmpdir"' EXIT INT TERM HUP
+
+cp -r test/ $tmpdir/test
+find test/ -name '*.js' -print0 | \
+ xargs -0 -n1 \
+ sh -c 'set -e; echo "Create: $5"; sed -E -e "$1" -e "$2" < "$4" > "$3/$4"' sedtape "$SEDCMD1" "$SEDCMD2" "$tmpdir"
+mocha $tmpdir/test/test.js
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-unicode-tr51.git
More information about the Pkg-javascript-commits
mailing list