Add basic tests for all non DOM/Window calls
Note that these are very basic tests and just a start to learn vitest. There are no tests for DOM/Window because I do not know how to do those tests the best way with some headless brower testing suit or which to use
This commit is contained in:
@@ -19,10 +19,11 @@ import {
|
||||
}); */
|
||||
|
||||
describe("randomIdF", () => {
|
||||
it('Should create a 10 character long random id', () => {
|
||||
it('Should create a 10 or 11 character long random id', () => {
|
||||
let rand_id = randomIdF();
|
||||
expect(rand_id).lengthOf(11);
|
||||
expect(rand_id).match(/^[a-z0-9]{11}$/);
|
||||
expect(rand_id.length).toBeGreaterThanOrEqual(10);
|
||||
expect(rand_id.length).toBeLessThanOrEqual(11);
|
||||
expect(rand_id).match(/^[a-z0-9]{10,11}$/);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user