e2e-testid 1.0.3 → 1.0.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/index.d.ts +48 -0
- package/package.json +3 -1
package/index.d.ts
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
export type TidPart = string | number;
|
|
2
|
+
|
|
3
|
+
export type TidConfig = {
|
|
4
|
+
enabled?: boolean;
|
|
5
|
+
attr?: string;
|
|
6
|
+
sep?: string;
|
|
7
|
+
sanitizer?: (value: string) => string;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export type TidRuntimeConfig = {
|
|
11
|
+
enabled: boolean;
|
|
12
|
+
attr: string;
|
|
13
|
+
sep: string;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export type TidProps = Record<string, unknown>;
|
|
17
|
+
|
|
18
|
+
export declare function configure(options?: TidConfig): TidRuntimeConfig;
|
|
19
|
+
|
|
20
|
+
export declare function getConfig(): TidRuntimeConfig;
|
|
21
|
+
|
|
22
|
+
export declare function isEnabled(): boolean;
|
|
23
|
+
|
|
24
|
+
export declare function tid(
|
|
25
|
+
id: string | TidPart[],
|
|
26
|
+
extraProps?: Record<string, unknown>
|
|
27
|
+
): Record<string, unknown>;
|
|
28
|
+
|
|
29
|
+
export declare function tidValue(id: string | TidPart[]): string;
|
|
30
|
+
|
|
31
|
+
export type TidBuilder = {
|
|
32
|
+
(...parts: TidPart[]): string;
|
|
33
|
+
base(): string;
|
|
34
|
+
of(...parts: TidPart[]): string;
|
|
35
|
+
tid(...parts: TidPart[]): Record<string, unknown>;
|
|
36
|
+
value(...parts: TidPart[]): string;
|
|
37
|
+
with(
|
|
38
|
+
parts: TidPart[] | TidPart,
|
|
39
|
+
extraProps?: Record<string, unknown>
|
|
40
|
+
): Record<string, unknown>;
|
|
41
|
+
child(childNamespace: string): TidBuilder;
|
|
42
|
+
enable(): TidRuntimeConfig;
|
|
43
|
+
disable(): TidRuntimeConfig;
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
export declare function createTid(namespace: string): TidBuilder;
|
|
47
|
+
|
|
48
|
+
export declare function makeJourneyTid(feature: string, screen: string): TidBuilder;
|
package/package.json
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "e2e-testid",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.4",
|
|
4
4
|
"description": "A small utility for stable and consistent data-testid generation for E2E testing.",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"author": "Taha Kourani",
|
|
7
7
|
"type": "commonjs",
|
|
8
8
|
"main": "index.js",
|
|
9
|
+
"types": "index.d.ts",
|
|
9
10
|
"exports": {
|
|
10
11
|
".": "./index.js"
|
|
11
12
|
},
|
|
@@ -29,6 +30,7 @@
|
|
|
29
30
|
"homepage": "https://github.com/TechTaha-lab/react-packages#readme",
|
|
30
31
|
"files": [
|
|
31
32
|
"index.js",
|
|
33
|
+
"index.d.ts",
|
|
32
34
|
"README.md",
|
|
33
35
|
"LICENSE"
|
|
34
36
|
],
|