var factorial = require('../');
var should = require('should');
require('mocha');

describe('factorial', function() {
  it('should error with -1', function(done) {
    try {
      factorial(-1);
    } catch (err) {
      should.exist(err);
      return done();
    }
    done(new Error('Not thrown!'));
  });
  it('should work with 0', function(done) {
    factorial(0).should.equal(1);
    done();
  });
  it('should work with 10', function(done) {
    factorial(10).should.equal(3628800);
    done();
  });
  it('should work with 21', function(done) {
    factorial(21).should.equal(51090942171709440000);
    done();
  });
});

@@ -128,13 +128,18 @@
 uld 
-error
+return NaN
  wit
@@ -170,20 +170,14 @@
     
-try %7B%0A      
+isNaN(
 fact
@@ -189,115 +189,39 @@
 (-1)
-;%0A    %7D catch (err) %7B%0A      should.exist(err);%0A      return done();%0A    %7D%0A    done(new Error('Not thrown!')
+).should.equal(true);%0A    done(
 );%0A 

test for NaN