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. replicator.js.patch
        2 kB
        Bob Dionne
      2. replication.js.patch
        2 kB
        Bob Dionne

        Activity

        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Closed Closed
        21h 43m 1 Filipe Manana 20/Aug/10 12:30
        Filipe Manana made changes -
        Status Open [ 1 ] Closed [ 6 ]
        Resolution Fixed [ 1 ]
        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.
        Bob Dionne made changes -
        Attachment replication.js.patch [ 12452528 ]
        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
        Bob Dionne made changes -
        Field Original Value New Value
        Attachment replicator.js.patch [ 12452519 ]
        Hide
        Bob Dionne added a comment -

        fixes replicator.js in standalone mode

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

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development