add unit test framework

This commit is contained in:
ericzhang
2013-05-17 14:06:10 +08:00
parent 718c466618
commit 5053b12983
3 changed files with 20 additions and 1 deletions
+1
View File
@@ -1 +1,2 @@
*.log
node_modules
+6 -1
View File
@@ -1,2 +1,7 @@
test:
.PHONY: all test clean
all:
test:
mocha test/tests.js -R spec
clean:
+13
View File
@@ -0,0 +1,13 @@
require('chai').should();
var random = require('../src/random');
describe('Random', function () {
describe('generate', function () {
it ('should generate random number with Arcsine', function () {
random.arcsine(0, 1).should.be.a('number');
});
it ('should generate random number with Beta', function () {
random.arcsine(0.5, 5, 0, 3).should.be.a('number');
});
});
});