premasagar / pablo

Pablo is a lightweight, expressive JavaScript SVG library. Pablo creates interactive drawings with SVG (Scalable Vector Graphics), giving access to all of SVG's granularity and power.
https://pablojs.com
MIT License
413 stars 16 forks source link

tests: Add tests for scope of `this` in all methods that accept callback functions #58

Closed premasagar closed 11 years ago

premasagar commented 11 years ago

e.g. see tests for some()

The default this should be tested in the callback function. For methods that accept an optional context argument, the success of the context object being applied should be tested.

AaronAcerboni commented 11 years ago

Methods which accept a function:

children parent parents parentsSvg root viewport viewports owner owners firstChild lastChild siblings nextSiblings prevSiblings next prev each map sort select every some on off one oneEach template

premasagar commented 11 years ago

Also indexOf / lastIndexOf (an alias of indexOf)

Note that all the traversal methods use the same main traverse function, and the insertion method use the same insert function, so that might simplify testing.

Premasagar Rose, Dharmafly http://dharmafly.com dharmafly.com / 07941 192398 premasagar.com twitter.com/premasagar L4RP.com asyncjs.com

AaronAcerboni commented 11 years ago

2fc8f75da187ef3b8fa9fb1b1f25c5592081ecf4