Jason, All methods in the `assert` module return undefined instead of returning a Boolean representing the result. While this would make sense in the affirmative case: console.log(assert(true)) => "true"
It stops making sense once the assertion is false. Because it throws an AssertionError, the console.log statement would never happen anyway. Does that answer your question? Is there another pattern we can recommend here to get you what you need? On Tue, Jul 30, 2013 at 2:54 AM, Ben Noordhuis <[email protected]> wrote: > On Tue, Jul 30, 2013 at 2:32 AM, Jason Hardin <[email protected]> > wrote: > > I am using node 0.10.15 and zombie 1.4.1 on an openshift.com site. When > I > > use the following code: > > console.log(assert.ok(browser.query('ul.pagination li.last button'))); > > > > I get a printed value of undefined when the element exists when I log it > > using > > console.log(browser.query('ul.pagination li.last button')); > > > > I was assuming that I would get a value of true. My if statement is > failing > > on this statement as well and I need it to pass when the element exists. > > > > Any help would be appreciated. > > I'm not sure what your question is. Yes, assert.ok() doesn't return > anything. It checks if a condition holds and throws an exception when > it doesn't. > > -- > -- > Job Board: http://jobs.nodejs.org/ > Posting guidelines: > https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines > You received this message because you are subscribed to the Google > Groups "nodejs" group. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected] > For more options, visit this group at > http://groups.google.com/group/nodejs?hl=en?hl=en > > --- > You received this message because you are subscribed to the Google Groups > "nodejs" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/groups/opt_out. > > > -- -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this message because you are subscribed to the Google Groups "nodejs" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/nodejs?hl=en?hl=en --- You received this message because you are subscribed to the Google Groups "nodejs" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.
