question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

assert.exists is not a function

See original GitHub issue

I tried it on a functional model and change the function exists not know dependencies": { “express”: “^4.14.0”, “cors”: “^2.8.1”, “body-parser”: “^1.15.2”, “chai”: “^3.5.0”, “mongodb”: “^3.1.3”, “chai-http”: “^3.0.0”, “mocha”: “^3.2.0”, “zombie”: “^5.0.5”, “helmet”: “^3.1.0”, “mongoose”: “^5.2.8”, “x-xss-protection”: “^1.1.0” },

test(‘Every field filled in’, function(done) {

   chai.request(server)
    .post('/api/issues/test')
    .send({
      issue_title: title,
      issue_text: 'text',
      created_by: 'Functional Test - Every field filled in',
      assigned_to: 'Chai and Mocha',
      status_text: 'In QA'
    })
    .end(function(err, res){
     if(err)   console.log( err);
      assert.equal(res.status, 200);
  //   console.log(  res.body.issue_text);
    // console.log( "re"+JSON.stringify( res));
      assert.isDefined(res.body.issue_title,title);
     assert.exists(res.body.issue_text,'text');
        assert.equal(res.body.created_by,'Functional Test - Every field filled in');
       assert.equal(res.body.assigned_to,'Chai and Mocha');
       assert.equal(res.body.status_text,'In QA');
       idtest=res.body._id
      done();
    });

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
lubodrinkacommented, Nov 12, 2018

Hey this os nonsense, nobody look in there, nobody. rewrite the manual.

1reaction
lubodrinkacommented, Nov 12, 2018

Oh god you are lazy man. Let assume use 4.0. and you don’t have somewhere that must be with new declarations in brackets. So if somebody try that oh that not working so rather use 3.5 version. there is tons of prefabricated solutions or done with 3.5 and someone want add another function … I don’t even believe I must tell you.

Read more comments on GitHub >

github_iconTop Results From Across the Web

TypeError: assert.isNotEmpty is not a function with chai assert
I'm getting assert.isNotEmpty is not a function in mocha test when asserting with chai. I have "chai": "^4.1.2" defined in package.json
Read more >
API Reference - Chai Assertion Library
Asserts that object does not have a property named by property , which can be a string using dot- and bracket-notation for nested...
Read more >
chai.Assertion.exist JavaScript and Node.js code examples
How to use. exist. function. in. Assertion ... { it('does not create and returns 400 with the validation error', async () => {...
Read more >
Assert - Chai
Asserts that function will not throw an error that is an instance of constructor , or alternately that it will not throw an...
Read more >
Assert | Node.js v19.3.0 Documentation
The node:assert module provides a set of assertion functions for verifying invariants. ... Throws value if value is not undefined or null ....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found