X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=test.coffee;h=62b297c9fb5977d5823bc731e4ccacd6f6523ad2;hb=a77c7e459842f78d78161bc4a3f330ec1d0c2693;hp=6ebcaa33f21e00017564c13209e3a68c0a915e39;hpb=e7cac479773cf44f9ae28a3f559cef095b19e361;p=peach-html5-editor.git diff --git a/test.coffee b/test.coffee index 6ebcaa3..62b297c 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 = '' @@ -7972,11 +7972,8 @@ serialize_els = (els, prefix = '| ') -> ret += "#{prefix}UNKNOWN TAG TYPE #{el.type}" return ret -test_results = passed: 0, failed: 0, fragment: 0, pending: 0 +test_results = passed: 0, failed: 0 test_parser = (args) -> - if args.fragment? # hide fragment tests for now - test_results.fragment += 1 - return wheic.debug_log_reset() parse_errors = [] args.error_cb = (i) -> @@ -8003,7 +8000,7 @@ test_parser = (args) -> test_results.passed += 1 # console.log "passed \"#{args.name}\"" test_summary = -> - console.log "Tests passed: #{test_results.passed}, Failed: #{test_results.failed}, fragment: #{test_results.fragment}" + console.log "Tests passed: #{test_results.passed}, Failed: #{test_results.failed}" next_test = 0