The document
object is contained within the zombie browser. If your code doesn't find document
, it is likely you are not running it within the zombie sandbox context.
Are you loading your library via zombie.visit('/page/with/library')
or are you requiring it directly and trying to use it within the test?
It is best to test complete webpages rather than libraries. You should create a test page that has a few buttons/links on it which test different functions of the library, and pressButton
or visit
those with zombie.