add more tests (#26)

* added more tests

* (fix) no cpu profile.
This commit is contained in:
2021-04-29 21:42:51 +02:00
committed by GitHub
parent 23418bbc60
commit 924fca5b90
14 changed files with 196 additions and 39 deletions

View File

@ -0,0 +1,19 @@
require('module-alias/register');
const { Random } = require('@dsabot/Random');
it('should return with no min or max value', () => {
expect(Random.int()).toBeUndefined();
});
it('call for use should return true', () => {
expect(Random.use(null)).toBeTruthy();
});
it('should return between 1 and 2', () => {
expect(Random.int(1, 2)).toBeGreaterThanOrEqual(1);
});
it('should return between 1 and 2', () => {
expect(Random.int(1, 2)).toBeLessThanOrEqual(2);
});
it('should return exactly 1', () => {
expect(Random.int(1, 1)).toBe(1);
});