@globisnv/cypress-core 0.0.9 → 0.0.10
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/dist/tsHelper.d.ts +4 -2
- package/dist/tsHelper.js +7 -6
- package/package.json +1 -1
package/dist/tsHelper.d.ts
CHANGED
|
@@ -141,9 +141,11 @@ export declare function parseLocalizedNumber(value: string | number | undefined)
|
|
|
141
141
|
*
|
|
142
142
|
* Gets the jenkins build number to use as a UUID,
|
|
143
143
|
* will fall back to a random generated 4-character UUID if not found.
|
|
144
|
-
*
|
|
144
|
+
* Each suffix keeps its own UUID: the first call for a suffix creates it, later calls reuse it.
|
|
145
|
+
* @param {string} [suffix] Optional suffix to get a UUID separate from the default one.
|
|
146
|
+
* @returns {string} CYP + build number or random 4-character UUID, followed by the suffix if given
|
|
145
147
|
*/
|
|
146
|
-
export declare const getOrCreateUuid: (
|
|
148
|
+
export declare const getOrCreateUuid: (suffix?: string) => string;
|
|
147
149
|
/**
|
|
148
150
|
* Returns the ISO 8601 week number for the given date.
|
|
149
151
|
*
|
package/dist/tsHelper.js
CHANGED
|
@@ -151,16 +151,17 @@ export function parseLocalizedNumber(value) {
|
|
|
151
151
|
*
|
|
152
152
|
* Gets the jenkins build number to use as a UUID,
|
|
153
153
|
* will fall back to a random generated 4-character UUID if not found.
|
|
154
|
-
*
|
|
154
|
+
* Each suffix keeps its own UUID: the first call for a suffix creates it, later calls reuse it.
|
|
155
|
+
* @param {string} [suffix] Optional suffix to get a UUID separate from the default one.
|
|
156
|
+
* @returns {string} CYP + build number or random 4-character UUID, followed by the suffix if given
|
|
155
157
|
*/
|
|
156
|
-
export const getOrCreateUuid = (
|
|
157
|
-
const
|
|
158
|
-
const envKey = id !== undefined ? `BUILD_UUID_${id}` : 'BUILD_UUID';
|
|
158
|
+
export const getOrCreateUuid = (suffix) => {
|
|
159
|
+
const envKey = suffix ? `BUILD_UUID_${suffix}` : 'BUILD_UUID';
|
|
159
160
|
let uuid = Cypress.expose(envKey);
|
|
160
161
|
if (!uuid) {
|
|
161
162
|
const buildNumber = Cypress.expose('BUILD_NUMBER');
|
|
162
|
-
const
|
|
163
|
-
uuid = buildNumber ? `CYP${buildNumber}${
|
|
163
|
+
const postfix = suffix ? `-${suffix}` : '';
|
|
164
|
+
uuid = buildNumber ? `CYP${buildNumber}${postfix}` : `CYP${getUUID(4)}${postfix}`;
|
|
164
165
|
Cypress.expose({ [envKey]: uuid });
|
|
165
166
|
}
|
|
166
167
|
return uuid;
|