Uploaded image for project: 'CouchDB'
  1. CouchDB
  2. COUCHDB-1417

Running individual JS tests at the CLI fails

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 1.2
    • 2.0.0, 1.6.1
    • Test Suite
    • None
    • New Contributors Level (Easy)

    Description

      Running the following in the 1.2.x branch does not work:

      $ ./test/javascript/run share/www/script/test/rewrite.js
      [couchjs] Error: No XMLHTTPRequest support detected

      The cause is that the runner concatenates several files into one script:

      cat couchdb/share/www/script/json2.js couchdb/share/www/script/sha1.js couchdb/share/www/script/oauth.js couchdb/share/www/script/couch.js couchdb/share/www/script/couch_test_runner.js couchdb/share/www/script/couch_tests.js share/www/script/test/rewrite.js couchdb/test/javascript/couch_http.js couchdb/test/javascript/cli_runner.js

      If the final statement before couch_http.js is missing a semicolon, then couch_http.js will look like a function invocation.

      The fix is to modify couch_http.js to be completely protected from whatever statements may have preceded it.

      Attachments

        Activity

          People

            Unassigned Unassigned
            jhs Jason Smith
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: