-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
249a271
commit 9ab7167
Showing
2 changed files
with
39 additions
and
0 deletions.
There are no files selected for viewing
32 changes: 32 additions & 0 deletions
32
test/baseGenerators/numeric/ConstantNumberGenerator.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { ConstantNumberGenerator } from '../../../src'; | ||
|
||
describe('StringGenerator class', () => { | ||
it('should return a specified string', () => { | ||
const generator = new ConstantNumberGenerator({ | ||
num: 3 | ||
}) | ||
|
||
expect(generator.get()).toBe(3); | ||
}); | ||
|
||
it('should raise an error on undefined value', () => { | ||
const conf = { num: undefined } | ||
|
||
//@ts-ignore | ||
expect(() => new ConstantNumberGenerator(conf)).toThrow(); | ||
}); | ||
|
||
it('should raise an error on null value', () => { | ||
const conf = { num: null } | ||
|
||
//@ts-ignore | ||
expect(() => new ConstantNumberGenerator(conf)).toThrow(); | ||
}); | ||
|
||
it('should raise an error on not-number value', () => { | ||
const conf = { num: "string" } | ||
|
||
//@ts-ignore | ||
expect(() => new ConstantNumberGenerator(conf)).toThrow(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters