CouchDB
  1. CouchDB
  2. COUCHDB-862

replicator.js fails to run in standalone js tests

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Trivial Trivial
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Test Suite
    • Labels:
      None
    • Environment:

      OS X

      Description

      replicator.js uses some jQuery functions such as jQuery.each and inArray, which causes it to fail when tests are run outside the browser

      1. replication.js.patch
        2 kB
        Bob Dionne
      2. replicator.js.patch
        2 kB
        Bob Dionne

        Activity

        Hide
        Filipe Manana added a comment -

        Applied to trunk revision 987457.

        Thanks Bob.

        Show
        Filipe Manana added a comment - Applied to trunk revision 987457. Thanks Bob.
        Hide
        Bob Dionne added a comment -

        clean up sloppy JS

        Show
        Bob Dionne added a comment - clean up sloppy JS
        Hide
        Filipe Manana added a comment -

        Bob, thanks for the patch.

        The use of those jQuery functions is actually my fault.

        I looked at the patch and have the following remarks:

        1) don't do toString.call(repResult.history) === "[object Array]"
        do instead repResult.history instanceof Array

        2) the replacement for $.inArray would be array.indexOf(element) (return value -1 means not found, else found)
        therefore avoiding those for loops to search for the element

        thanks

        Show
        Filipe Manana added a comment - Bob, thanks for the patch. The use of those jQuery functions is actually my fault. I looked at the patch and have the following remarks: 1) don't do toString.call(repResult.history) === " [object Array] " do instead repResult.history instanceof Array 2) the replacement for $.inArray would be array.indexOf(element) (return value -1 means not found, else found) therefore avoiding those for loops to search for the element thanks
        Hide
        Bob Dionne added a comment -

        fixes replicator.js in standalone mode

        Show
        Bob Dionne added a comment - fixes replicator.js in standalone mode

          People

          • Assignee:
            Unassigned
            Reporter:
            Bob Dionne
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development