1
0
Fork 0

Use node --harmony-destructuring when available

In newer versions of node, this flag goes away and it is enabled by
default.

* Makefile.am (test): Add NODE_DESTRUCTURE to mocha invocation.
* configure.ac (NODE, NODE_DESTRUCTURE): Add variables.

DEV-2296
master
Mike Gerwitz 2017-01-27 10:59:36 -05:00
parent 7ee9e11337
commit af7813e605
2 changed files with 16 additions and 1 deletions

View File

@ -41,6 +41,9 @@ modindex: $(nsindex)
test: check
check:
@PATH="$(PATH):$(CURDIR)/node_modules/mocha/bin" \
mocha --require $(path_test)/pre.js --recursive $(TESTARGS)
mocha @NODE_DESTRUCTURE@ \
--require $(path_test)/pre.js \
--recursive \
$(TESTARGS)
FORCE:

View File

@ -29,6 +29,18 @@ AC_SUBST(MINOR, m4_argn(2, ver_split))
AC_SUBST(REV, m4_argn(3, ver_split))
AC_SUBST(SUFFIX, m4_argn(4, ver_split))
AC_ARG_VAR([NODE], [The node.js interpreter])
AC_CHECK_PROGS(NODE, [node nodejs])
test -n "$NODE" || AC_MSG_ERROR([missing Node.js])
# only needed for older versions of Node
AC_MSG_CHECKING([node --harmony_destructuring])
AS_IF([node --harmony_destructuring >/dev/null 2>/dev/null],
[AC_MSG_RESULT(available)
AC_SUBST([NODE_DESTRUCTURE], [--harmony-destructuring])],
[AC_MSG_RESULT(no)])
# generate files from their *.in counterparts
AC_CONFIG_FILES([Makefile doc/Makefile package.json src/version.js])
AC_OUTPUT