X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=test.coffee;h=fabb61bc0322e8cbb4cbc258abacc1e5b2d2a2af;hb=071a77b51a7f9ba5da51b3fc43885e63771bc566;hp=02ebec3f200017b855b8deb68151c6ad807c0348;hpb=117324a8df5cdebe01529adb0bc8909526031536;p=peach-html5-editor.git diff --git a/test.coffee b/test.coffee index 02ebec3..fabb61b 100644 --- a/test.coffee +++ b/test.coffee @@ -26,8 +26,8 @@ # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -# The rest of this file was written by Jason Woofenden in 2015, and is released -# under the terms of the CC0 license: +# The rest of this file was written by Jason Woofenden in 2015-2016, and is +# released under the terms of the CC0 license: # http://creativecommons.org/publicdomain/zero/1.0/ and into the public domain tests = [ @@ -7931,10 +7931,10 @@ tests = [ } ] -if window?.wheic? - wheic = window.wheic +if typeof module isnt 'undefined' and module.exports? + wheic = require './parse-html.coffee' else - wheic = require './wheic.js' + wheic = window.wheic serialize_els = (els, prefix = '| ') -> ret = '' @@ -7979,7 +7979,7 @@ test_parser = (args) -> args.error_cb = (i) -> parse_errors.push i prev_node_id = 0 # reset counter - parsed = wheic.parse_html args + parsed = wheic.parse_html args.html, args serialized = serialize_els parsed if serialized isnt args.expected test_results.failed += 1