mirror of
https://github.com/wassname/random.js.git
synced 2026-09-09 11:32:35 +08:00
add unit test framework
This commit is contained in:
@@ -1 +1,2 @@
|
||||
*.log
|
||||
node_modules
|
||||
|
||||
@@ -1,2 +1,7 @@
|
||||
test:
|
||||
.PHONY: all test clean
|
||||
all:
|
||||
|
||||
test:
|
||||
mocha test/tests.js -R spec
|
||||
|
||||
clean:
|
||||
|
||||
@@ -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');
|
||||
});
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user