Problem with assert

138 views
Skip to first unread message

Jackie Gleason

unread,
Jul 29, 2012, 4:25:24 PM7/29/12
to moc...@googlegroups.com
I have the following code...

describe('cookie', function(){
  ..
  describe('#execute()',function(){
    it('Should return a cookie', function(){
      cookie.setUsername("user");
      cookie.setPassword("password");
                .get('/ServiceLogin?service=sj')
                .reply(200, '<input type="hidden" name="dsh" id="dsh" value="-4906219821262685280"><input type="hidden" name="GALX" value="eSdl2XQF6dk">');
      cookie.execute(function(err,dsh,galx,cookie){
        console.log('-4906219821262685280' == dsh)
        assert.equals('-4906219821262685280',dsh)
        assert.equals('eSdl2XQF6dk',galx)
      })
    })


But when I run I see...


true
.

  ✖ 1 of 2 tests failed:

  1) cookie #execute() Should return a cookie:
     TypeError: Object function ok(value, message) {
  if (!!!value) fail(value, true, message, '==', assert.ok);
} has no method 'equals'


What do I have to do to get this right?

Domenic Denicola

unread,
Jul 29, 2012, 4:37:20 PM7/29/12
to moc...@googlegroups.com

I think it’s assert.equal, not assert.equals:

 

http://nodejs.org/docs/latest/api/assert.html

Jackie Gleason

unread,
Jul 29, 2012, 4:48:49 PM7/29/12
to moc...@googlegroups.com
Dope thanks!
Reply all
Reply to author
Forward
0 new messages