mobify/selector-utils — pull request #12 by fractaltheory (2014-12-16 23:24:57+00:00)
Title: Added tests and refactored traversal utils

(Originally authored by @donnielrt)

This PR is opened based on #5 --- we originally were going to emulate jQuery's dir() function but determined it was essentially doing the same thing Don has written here. In particular, the main difference was the [test for nodeType !== 9](https://github.com/jquery/jquery/blob/master/src/traversing.js#L24) (i.e. document node), however this check is necessary only for traversals like .parents() (which we aren't implementing here). Additionally, since we are using Zepto's .prev() and .next() functions for our heavy lifting, we do not need to check for [nodeType == 1](https://github.com/jquery/jquery/blob/master/src/traversing.js#L25) (i.e. element node).

The tests Don had written from #5 are present here as well.

Status: **Opened for review**

Reviewers: @donnielrt @scalvert

## How to test-drive this PR
- Install this branch into a project and compare behavior to a jQuery instance of nextAll and nextUntil

## Research resources
- https://github.com/jquery/jquery/blob/master/src/traversing.js#L24
- http://api.jquery.com/nextall/
- http://api.jquery.com/nextuntil/