1
0
Fork 0

add es6-promise shim

It is expected that support for promises will be available in whatever
environment liza is run.  Here, we're adding a shim for the sake of testing
in ancient environments.

It's almost as if I'm stuck using an ancient environment somewhere...*cough*
master
Mike Gerwitz 2016-03-01 00:48:36 -05:00
parent 578c064538
commit 78c3cc63e1
3 changed files with 28 additions and 3 deletions

View File

@ -18,7 +18,8 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
##
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:

View File

@ -19,7 +19,8 @@
},
"devDependencies": {
"chai": ">=1.9.1",
"mocha": ">=1.18.2"
"mocha": ">=1.18.2",
"es6-promise": "~3"
},
"licenses": [

23
test/pre.js 100644
View File

@ -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 <http://www.gnu.org/licenses/>.
*/
// polyfill for ancient environments
require( 'es6-promise' ).polyfill();