title: Test the return of functions with parameters in Mocha with Chai
body: <p>I wrote a basic mocha unit test to test my algorithm challenges in node. I would like an example of a mocha with chai library unit test testing the return of the function with inserted function parameters.</p>
  
  <p>// algorithm.js (the function)</p>
  
  <pre><code>var alg = function(num) {
    return num;
  }
  </code></pre>
  
  <p>module.exports = alg;</p>
  
  <p>// spec/algorithm.js (the test)</p>
  
  <pre><code>var path = require('path');
  var expect = require('chai').expect;
  
  var algorithm = require(path.join(__dirname, '..', './algorithm.js'));
  
  describe('algorithm()', function () {
    'use strict';
  
    it('exists', function () {
      expect(algorithm).to.be.a('function');
  
    });
  
    /*    ******* What should this be *******     */
   it('should equal 1', function () {
      expect(algorithm.alg(1)).to.equal(1);
   });
  });
  </code></pre>
  
  <p>I used yeoman test-generator to generate the node setup. The first test to test if 'alg' is a function passes but I don't know what the second test should be after reading the documentation.</p>