@getjones/test-infra 1.3.3 → 1.3.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
const { v4: uuidv4 } = require('uuid');
|
|
2
|
+
|
|
3
|
+
const getRandomNumberInRange = (min, max) => {
|
|
4
|
+
min = Math.ceil(min);
|
|
5
|
+
max = Math.floor(max);
|
|
6
|
+
return Math.floor(Math.random() * (max - min + 1)) + min;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
const getCapitalLetterUnicodeValueList = ({ listLength = 26 }) => {
|
|
10
|
+
//This code number represent the letter A
|
|
11
|
+
const firstLetterUnicodeValue = 65;
|
|
12
|
+
//Return list of unicodes values for all alphabet letters.
|
|
13
|
+
//The index value will be in the ranges between 1-26 (The English alphabet has 26 letters)
|
|
14
|
+
//In case listLength will be bigger then 26, index will start the cycle again respectively to the ranges
|
|
15
|
+
return Array.from(Array(listLength)).map((_, index) => (index % 26) + firstLetterUnicodeValue);
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
const getUniqueNumber = () => {
|
|
19
|
+
return uuidv4();
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
module.exports = { getRandomNumberInRange, getCapitalLetterUnicodeValueList, getUniqueNumber };
|
|
@@ -4,7 +4,7 @@ const globalRecordModels = require('../models/global.record.model');
|
|
|
4
4
|
const { CreateGlobalRecordModel } = globalRecordModels;
|
|
5
5
|
const { createGlobalRecord, getAllGlobalRecordsInPage } = globalRecordServices;
|
|
6
6
|
|
|
7
|
-
const { getCapitalLetterUnicodeValueList, getUniqueNumber } = require('
|
|
7
|
+
const { getCapitalLetterUnicodeValueList, getUniqueNumber } = require('../../../../common/utils/numberUtils');
|
|
8
8
|
|
|
9
9
|
const { SERVICE_AREAS } = require('../consts');
|
|
10
10
|
|