diff --git a/Makefile.am b/Makefile.am
index 8e8d673..ee3f93d 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -18,7 +18,8 @@
# along with this program. If not, see .
##
-path_src = $(top_builddir)/src
+path_src = $(top_builddir)/src
+path_test = $(top_builddir)/test
namespaces=$(shell find src -type d)
nsindex=$(addsuffix /index.js, $(namespaces))
@@ -37,6 +38,6 @@ modindex: $(nsindex)
test: check
check:
@PATH="$(PATH):$(CURDIR)/node_modules/mocha/bin" \
- mocha --recursive $(TESTARGS)
+ mocha --require $(path_test)/pre.js --recursive $(TESTARGS)
FORCE:
diff --git a/package.json.in b/package.json.in
index b0e714d..3742cba 100644
--- a/package.json.in
+++ b/package.json.in
@@ -19,7 +19,8 @@
},
"devDependencies": {
"chai": ">=1.9.1",
- "mocha": ">=1.18.2"
+ "mocha": ">=1.18.2",
+ "es6-promise": "~3"
},
"licenses": [
diff --git a/test/pre.js b/test/pre.js
new file mode 100644
index 0000000..5189391
--- /dev/null
+++ b/test/pre.js
@@ -0,0 +1,23 @@
+/**
+ * Pre-test setup
+ *
+ * Copyright (C) 2016 LoVullo Associates, Inc.
+ *
+ * This file is part of liza.
+ *
+ * liza is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+// polyfill for ancient environments
+require( 'es6-promise' ).polyfill();