1. 29 Apr, 2016 1 commit
    • Robert Knight and Sheetal Umesh Kumar's avatar
      Show adder if user makes a selection and then launches the plugin. · 487d782e
      If a user selects some text, and then realises that Hypothesis isn't
      active, their first reaction will probably be to activate Hypothesis.
      In this scenario, we should pop up the adder near the selection on launch.
      
       * If there is a selection when the 'ready' event fires, show the adder
         at the focus point of the selection.
      
       * For consistency, show the adder at the focus point of the selection
         after a selection whilst Hypothesis is active.
      
       * Add 'range-util' module which provides utility functions to get
         the coordinates at the end of the selection.
      
         'range-util' uses the DOM Range, Selection and NodeIterator APIs directly
         rather than Annotator's Range functions for several reasons:
      
         1) Given that H now requires IE >= 10, all of our target browsers
            have all the APIs that we need.
      
         2) Using the DOM APIs directly proved easier to debug and test.
      487d782e
  2. 28 Apr, 2016 2 commits
  3. 27 Apr, 2016 2 commits
  4. 26 Apr, 2016 6 commits
    • Robert Knight's avatar
      Enable slow test reporting · 7bde508b
      Robert Knight authored
      This should help to catch slow tests in development before they become
      flakey failures on Travis.
      7bde508b
    • Robert Knight's avatar
      Fix two slow tests · 7f48a0c9
      Robert Knight authored
       * Avoid `assert.includes()` in Bridge test, since this does a deep
         equality comparison which is much more expensive than necessary
         (50-60ms to execute on a desktop system with no contention. I think
         this might explain the very occassional failure seen on Travis).
      
       * Use the correct name for the `retries` option in a
         retryPromiseOperation() test. This test should have failed but
         because the min timeout value was set so low, the test was taking < 2
         seconds to run even though it was retrying 10 times with an
         expontentially increasing timeout.
      7f48a0c9
    • Robert Knight's avatar
    • Robert Knight's avatar
      Fix error after an automatic incremental rebuild whilst running tests · 4b6c491f
      Robert Knight authored
      When running tests in `gulp watch` mode, the initial run passed but
      subsequent changes resulted in an error in the `merge-descriptors`
      package, related to PhantomJS.
      
      I haven't looked deeply into the problem but it does look like a
      familiar issue related to Proxyquire trying to 'call through' to the
      original imports in the module. Adding the '@noCallThru' flag in
      guest-test.coffee resolves the issue.
      4b6c491f
    • Robert Knight's avatar
      Switch to karma-mocha-reporter in tests · 2efd1860
      Robert Knight authored
      This produces more helpful output when test assertions involving deep
      equality checks fail.
      
      See https://www.npmjs.com/package/karma-mocha-reporter#showdiff
      
      This requires karma-mocha >= v0.2.2
      2efd1860
    • Robert Knight's avatar
      Update devDependencies to current versions, except for PhantomJS · 361906bb
      Robert Knight authored
      Update test and development dependencies to latest versions from npm,
      except for PhantomJS. The PhantomJS 1.9.x -> 2.x transition requires
      additional changes in tests.
      
      A couple of issues came up during the upgrade:
      
       - 'constructor' is no longer a valid name for describe() blocks
      
       - The require() in Karma's Browserify config ended up being resolved
         relative to the location of karma.config.js for reasons I haven't
         debugged, instead of looking in node_modules/. Using
         require.resolve() to get the absolute path works around the issue.
      361906bb
  5. 23 Apr, 2016 2 commits
  6. 22 Apr, 2016 2 commits
  7. 21 Apr, 2016 2 commits
  8. 20 Apr, 2016 14 commits
  9. 19 Apr, 2016 9 commits