Test cleanup and fixes [u-v]

This commit is contained in:
Angelos Chalaris
2018-06-18 18:52:13 +03:00
parent 46ad6c08b9
commit c0a42d906a
16 changed files with 135 additions and 157 deletions

View File

@ -1,16 +1,13 @@
const expect = require('expect');
const UUIDGeneratorNode = require('./UUIDGeneratorNode.js');
test('UUIDGeneratorNode is a Function', () => {
test('UUIDGeneratorNode is a Function', () => {
expect(UUIDGeneratorNode).toBeInstanceOf(Function);
});
const uuid = UUIDGeneratorNode();
test('Contains dashes in the proper places', () => {
expect([uuid[8], uuid[13], uuid[18], uuid[23]], ['-', '-', '-', '-']).toEqual()
const uuid = UUIDGeneratorNode();
test('Contains dashes in the proper places', () => {
expect([uuid[8], uuid[13], uuid[18], uuid[23]]).toEqual(['-', '-', '-', '-']);
});
test('Only contains hexadecimal digits', () => {
test('Only contains hexadecimal digits', () => {
expect(/^[0-9A-Fa-f-]+$/.test(uuid)).toBeTruthy();
});