You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@annotator.apache.org by GitBox <gi...@apache.org> on 2020/05/08 17:54:05 UTC

[GitHub] [incubator-annotator] Treora opened a new issue #77: Create tests for dom package

Treora opened a new issue #77:
URL: https://github.com/apache/incubator-annotator/issues/77


   I made a first small step in the [dom-tests](https://github.com/apache/incubator-annotator/tree/dom-tests) branch. Not yet sure what approach to take, but I thought to just start with some tests for text quote anchoring on small, artificial html documents, to test for various kinds of edge cases.
   
   A technical hurdle is that to test things in Node, we would need to run the code inside e.g. jsdom; does anybody know a simple way to do this? Something like [jsdom-global](https://github.com/rstacruz/jsdom-global) seems convenient, but that module looks outdated. [jest](https://github.com/facebook/jest) provides a jsdom environment by default, but we’d have to switch everything from mocha to jest.
   
   Currently I run tests in the browser (using `yarn start`), which works but I wonder how to get more useful output messages (it would not give me [`inlineDiffs`](https://mochajs.org/#diffs)). Help welcome.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-annotator] Treora commented on issue #77: Create tests for dom package

Posted by GitBox <gi...@apache.org>.
Treora commented on issue #77:
URL: https://github.com/apache/incubator-annotator/issues/77#issuecomment-646153752


   First tests merged in #79, more can be developed as we go. Closing this issue.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-annotator] Treora closed issue #77: Create tests for dom package

Posted by GitBox <gi...@apache.org>.
Treora closed issue #77:
URL: https://github.com/apache/incubator-annotator/issues/77


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-annotator] Treora commented on issue #77: Create tests for dom package

Posted by GitBox <gi...@apache.org>.
Treora commented on issue #77:
URL: https://github.com/apache/incubator-annotator/issues/77#issuecomment-629384737


   In the call yesterday we discussed moving to jest as a possible solution. [Karma](https://github.com/karma-runner/karma) was suggested as a way to run automated tests in actual browsers, not just jsdom; this seems a good thing to do anyway, @tilgovi volunteered to set this up soon.
   
   Also [global-jsdom](https://github.com/modosc/global-jsdom) was suggested, which is a recent reincarnation of [jsdom-global](https://github.com/rstacruz/jsdom-global) that is too outdated for us to use (likewise for [browser-env](https://github.com/lukechilds/browser-env/), etc; forking is the new maintaining). This seems to be usable for the time being, unblocking me right now!


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org