title: Assert function on basis of more than one response codes
body: <p>We have an API which requires token from another API response. Below I have cascaded the response of that API to the main API.</p>
  <p>How do I add assert function for more than one response codes. For the main API the response code should return 200. But if token passed is wrong it returns 401. If main API is down it returns different response code.</p>
  <p>So, I require a switch case type construct to check this in below code snippet, or a multiple assert block.</p>
  <pre><code>var assert = require('assert');
  var request = require('request');
  var options2,token,info;
  var options = {
  
    'method': 'POST',
  
    'url': '**',
  
    'headers': {
  
      'Content-Type': 'application/x-www-form-urlencoded'
  
    },
  
    form: {
  
      'client_id': **,
  
      'client_secret': **,
  
      'grant_type': 'client_credentials'
  
    }
  
  };
  
  request(options, function (error, response) {
  
    if (error) throw new Error(error);
  
       info = JSON.parse(response.body);
       console.log(info.access_token);
       token=info.access_token;
    
  
  
  
  var request = require('request');
  
  var options2 = {
  
    'method': 'GET',
  
    'url': '**',
  
    'headers': {
  
      'Content-Type': 'application/json',
  
      &quot;Authorization&quot;: &quot;Bearer &quot; + token,
    }
  
  };
  
  request(options2, function (error, response) {
  
    if (error) throw new Error(error);
    
  switch(response.statusCode)
      {
            
  case '200' :assert.ok(response.statusCode != 200, 'Expected 200 response'); 
             break;
  }
  });
  });
  </code></pre>