title: How can I test if my Express app's response contains certain HTML tags / text?
body: <p>I'm running an Express Node server, and using Mocha and Supertest to test my routes.</p>
  
  <p>I would like to be able to test for the existence of certain text in the response for one of my Express routes, as so:</p>
  
  <pre><code>it('should display form text input', function(done) {
        request(app)
          .get('/')
          .end(function (err, res) {
            if (err) {
              return done(err);
            }
            res.text.should.include('class="text-input-wname');
            done();
          });
      });  
  </code></pre>
  
  <p>However, when I run this test, I get the following error:</p>
  
  <pre><code>Uncaught TypeError: undefined is not a function
  </code></pre>
  
  <p>The res.text prints out fine to the console. I know that should.include() is meant to check for the existence of an element in an array, so presumed this might not work.</p>
  
  <p>But what is the correct way to parse the response body to check for the existence of some text?</p>