@vickbk/tests 0.0.0-stage → 0.2.0

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.
Files changed (59) hide show
  1. package/CHANGELOG.md +39 -0
  2. package/LICENSE +21 -0
  3. package/README.md +225 -2
  4. package/dist/console-Cf1taTRK.mjs +39 -0
  5. package/dist/console-Cf1taTRK.mjs.map +1 -0
  6. package/dist/dom-DeHbD1ni.mjs +459 -0
  7. package/dist/dom-DeHbD1ni.mjs.map +1 -0
  8. package/dist/index-CKsosUpb.d.mts +249 -0
  9. package/dist/index-CKsosUpb.d.mts.map +1 -0
  10. package/dist/index-DtGBqDev.d.mts +25 -0
  11. package/dist/index-DtGBqDev.d.mts.map +1 -0
  12. package/dist/index.cjs +3 -0
  13. package/dist/index.d.cts +6 -0
  14. package/dist/index.d.cts.map +1 -0
  15. package/dist/index.d.mts +6 -0
  16. package/dist/index.d.mts.map +1 -0
  17. package/dist/index.mjs +1 -0
  18. package/dist/pattern-to-regex-BrMJtzu8.cjs +19 -0
  19. package/dist/pattern-to-regex-BrMJtzu8.cjs.map +1 -0
  20. package/dist/pattern-to-regex-CO5Y0oDU.mjs +14 -0
  21. package/dist/pattern-to-regex-CO5Y0oDU.mjs.map +1 -0
  22. package/dist/playwright.cjs +327 -0
  23. package/dist/playwright.cjs.map +1 -0
  24. package/dist/playwright.d.cts +254 -0
  25. package/dist/playwright.d.cts.map +1 -0
  26. package/dist/playwright.d.mts +254 -0
  27. package/dist/playwright.d.mts.map +1 -0
  28. package/dist/playwright.mjs +308 -0
  29. package/dist/playwright.mjs.map +1 -0
  30. package/dist/promises.cjs +45 -0
  31. package/dist/promises.cjs.map +1 -0
  32. package/dist/promises.d.cts +34 -0
  33. package/dist/promises.d.cts.map +1 -0
  34. package/dist/promises.d.mts +34 -0
  35. package/dist/promises.d.mts.map +1 -0
  36. package/dist/promises.mjs +43 -0
  37. package/dist/promises.mjs.map +1 -0
  38. package/dist/react.cjs +173 -0
  39. package/dist/react.cjs.map +1 -0
  40. package/dist/react.d.cts +17 -0
  41. package/dist/react.d.cts.map +1 -0
  42. package/dist/react.d.mts +17 -0
  43. package/dist/react.d.mts.map +1 -0
  44. package/dist/react.mjs +170 -0
  45. package/dist/react.mjs.map +1 -0
  46. package/dist/rolldown-runtime-VH7oDXx4.cjs +28 -0
  47. package/dist/types-BlSFP07Z.d.cts +8 -0
  48. package/dist/types-BlSFP07Z.d.cts.map +1 -0
  49. package/dist/types-BlSFP07Z.d.mts +8 -0
  50. package/dist/types-BlSFP07Z.d.mts.map +1 -0
  51. package/dist/vitest/console.d.mts +2 -0
  52. package/dist/vitest/console.mjs +1 -0
  53. package/dist/vitest/dom.d.mts +2 -0
  54. package/dist/vitest/dom.mjs +1 -0
  55. package/dist/vitest.d.mts +49 -0
  56. package/dist/vitest.d.mts.map +1 -0
  57. package/dist/vitest.mjs +57 -0
  58. package/dist/vitest.mjs.map +1 -0
  59. package/package.json +165 -3
@@ -0,0 +1,49 @@
1
+ import { n as shutConsole, t as resetConsole } from "./index-DtGBqDev.mjs";
2
+ import { a as shouldSee, c as shouldHaveTestId, d as isChecked, f as clickLabelInput, h as ToggleState, i as togglePopover, l as shouldHaveAttributes, m as ToggleConfig, n as userTypes, o as shouldNotSee, p as fireEvent, r as userClicks, s as shouldNotHaveTestId, t as userTypesMultiple, u as isNotChecked } from "./index-CKsosUpb.mjs";
3
+ //#region src/features/promises/utils/resolvedPromise.d.ts
4
+ /**
5
+ * Creates a fulfilled promise augmented with Vitest's fulfilled-promise metadata.
6
+ *
7
+ * @param value The value with which the promise is fulfilled.
8
+ * @returns A fulfilled Promise<T> with `status: "fulfilled"` and its `value`.
9
+ * @example
10
+ * ```ts
11
+ * const payload = await resolvedPromise({ id: 1 });
12
+ * expect(payload).toEqual({ id: 1 });
13
+ * ```
14
+ */
15
+ declare function resolvedPromise$1<T>(value: T): Promise<T> & {
16
+ status: "fulfilled";
17
+ value: T;
18
+ };
19
+ //#endregion
20
+ //#region src/features/promises/utils/rejectedPromise.d.ts
21
+ /**
22
+ * Creates a rejected promise augmented with Vitest's rejected-promise metadata.
23
+ *
24
+ * @param reason The rejection reason, preserved as an unknown value; defaults to `undefined`.
25
+ * @returns A rejected Promise<never> with `status: "rejected"` and its `reason`.
26
+ * @example
27
+ * ```ts
28
+ * await expect(rejectedPromise(new Error("Request failed"))).rejects.toThrow("Request failed");
29
+ * ```
30
+ */
31
+ declare function rejectedPromise$1(reason?: unknown): Promise<never> & {
32
+ status: "rejected";
33
+ reason: unknown;
34
+ };
35
+ //#endregion
36
+ //#region src/features/vitest/index.d.ts
37
+ /**
38
+ * @deprecated Import `rejectedPromise` from `@vickbk/tests/promises` instead.
39
+ * This re-export is retained for backward compatibility.
40
+ */
41
+ export declare const rejectedPromise: typeof rejectedPromise$1;
42
+ /**
43
+ * @deprecated Import `resolvedPromise` from `@vickbk/tests/promises` instead.
44
+ * This re-export is retained for backward compatibility.
45
+ */
46
+ export declare const resolvedPromise: typeof resolvedPromise$1;
47
+ //#endregion
48
+ export { type ToggleConfig, type ToggleState, clickLabelInput, fireEvent, isChecked, isNotChecked, resetConsole, shouldHaveAttributes, shouldHaveTestId, shouldNotHaveTestId, shouldNotSee, shouldSee, shutConsole, togglePopover, userClicks, userTypes, userTypesMultiple };
49
+ //# sourceMappingURL=vitest.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vitest.d.mts","names":["resolvedPromise","rejectedPromise","_rejectedPromise","_resolvedPromise"],"sources":["../src/features/promises/utils/resolvedPromise.ts","../src/features/promises/utils/rejectedPromise.ts","../src/features/vitest/index.ts"],"mappings":";;;;;;;;;;;;;;iBAWgBA,kBAAgB,GAC9B,OAAO,IACN,QAAQ;EAAO;EAAqB,OAAO;;;;;;;;;;;;;;iBCH9BC,kBACd,mBACC;EAAmB;EAAoB;;;;;;;;qBCC7B,wBAAeC;;;;;qBAMf,wBAAeC"}
@@ -0,0 +1,57 @@
1
+ import { n as shutConsole, t as resetConsole } from "./console-Cf1taTRK.mjs";
2
+ import { a as shouldSee, c as shouldHaveTestId, d as isChecked, f as clickLabelInput, i as togglePopover, l as shouldHaveAttributes, n as userTypes, o as shouldNotSee, p as fireEvent, r as userClicks, s as shouldNotHaveTestId, t as userTypesMultiple, u as isNotChecked } from "./dom-DeHbD1ni.mjs";
3
+ //#region src/features/promises/utils/resolvedPromise.ts
4
+ /**
5
+ * Creates a fulfilled promise augmented with Vitest's fulfilled-promise metadata.
6
+ *
7
+ * @param value The value with which the promise is fulfilled.
8
+ * @returns A fulfilled Promise<T> with `status: "fulfilled"` and its `value`.
9
+ * @example
10
+ * ```ts
11
+ * const payload = await resolvedPromise({ id: 1 });
12
+ * expect(payload).toEqual({ id: 1 });
13
+ * ```
14
+ */
15
+ function resolvedPromise$1(value) {
16
+ const promise = Promise.resolve(value);
17
+ return Object.assign(promise, {
18
+ status: "fulfilled",
19
+ value
20
+ });
21
+ }
22
+ //#endregion
23
+ //#region src/features/promises/utils/rejectedPromise.ts
24
+ /**
25
+ * Creates a rejected promise augmented with Vitest's rejected-promise metadata.
26
+ *
27
+ * @param reason The rejection reason, preserved as an unknown value; defaults to `undefined`.
28
+ * @returns A rejected Promise<never> with `status: "rejected"` and its `reason`.
29
+ * @example
30
+ * ```ts
31
+ * await expect(rejectedPromise(new Error("Request failed"))).rejects.toThrow("Request failed");
32
+ * ```
33
+ */
34
+ function rejectedPromise$1(reason = void 0) {
35
+ const promise = Promise.reject(reason);
36
+ promise.catch((error) => error);
37
+ return Object.assign(promise, {
38
+ status: "rejected",
39
+ reason
40
+ });
41
+ }
42
+ //#endregion
43
+ //#region src/features/vitest/index.ts
44
+ /**
45
+ * @deprecated Import `rejectedPromise` from `@vickbk/tests/promises` instead.
46
+ * This re-export is retained for backward compatibility.
47
+ */
48
+ const rejectedPromise = rejectedPromise$1;
49
+ /**
50
+ * @deprecated Import `resolvedPromise` from `@vickbk/tests/promises` instead.
51
+ * This re-export is retained for backward compatibility.
52
+ */
53
+ const resolvedPromise = resolvedPromise$1;
54
+ //#endregion
55
+ export { clickLabelInput, fireEvent, isChecked, isNotChecked, rejectedPromise, resetConsole, resolvedPromise, shouldHaveAttributes, shouldHaveTestId, shouldNotHaveTestId, shouldNotSee, shouldSee, shutConsole, togglePopover, userClicks, userTypes, userTypesMultiple };
56
+
57
+ //# sourceMappingURL=vitest.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vitest.mjs","names":["resolvedPromise","rejectedPromise","_rejectedPromise","_resolvedPromise"],"sources":["../src/features/promises/utils/resolvedPromise.ts","../src/features/promises/utils/rejectedPromise.ts","../src/features/vitest/index.ts"],"sourcesContent":["/**\n * Creates a fulfilled promise augmented with Vitest's fulfilled-promise metadata.\n *\n * @param value The value with which the promise is fulfilled.\n * @returns A fulfilled Promise<T> with `status: \"fulfilled\"` and its `value`.\n * @example\n * ```ts\n * const payload = await resolvedPromise({ id: 1 });\n * expect(payload).toEqual({ id: 1 });\n * ```\n */\nexport function resolvedPromise<T>(\n value: T,\n): Promise<T> & { status: \"fulfilled\"; value: T } {\n const promise = Promise.resolve(value);\n return Object.assign(promise, { status: \"fulfilled\" as const, value });\n}\n","/**\n * Creates a rejected promise augmented with Vitest's rejected-promise metadata.\n *\n * @param reason The rejection reason, preserved as an unknown value; defaults to `undefined`.\n * @returns A rejected Promise<never> with `status: \"rejected\"` and its `reason`.\n * @example\n * ```ts\n * await expect(rejectedPromise(new Error(\"Request failed\"))).rejects.toThrow(\"Request failed\");\n * ```\n */\nexport function rejectedPromise(\n reason: unknown = undefined,\n): Promise<never> & { status: \"rejected\"; reason: unknown } {\n const promise = Promise.reject<never>(reason);\n\n promise.catch((error) => error);\n\n return Object.assign(promise, { status: \"rejected\" as const, reason });\n}\n","/* eslint-disable boundaries/dependencies */\nexport * from \"./modules/console\";\nexport * from \"./modules/dom\";\n\nimport {\n rejectedPromise as _rejectedPromise,\n resolvedPromise as _resolvedPromise,\n} from \"@/features/promises\";\n\n/**\n * @deprecated Import `rejectedPromise` from `@vickbk/tests/promises` instead.\n * This re-export is retained for backward compatibility.\n */\nexport const rejectedPromise = _rejectedPromise;\n\n/**\n * @deprecated Import `resolvedPromise` from `@vickbk/tests/promises` instead.\n * This re-export is retained for backward compatibility.\n */\nexport const resolvedPromise = _resolvedPromise;\n"],"mappings":";;;;;;;;;;;;;;AAWA,SAAgBA,kBACd,OACgD;CAChD,MAAM,UAAU,QAAQ,QAAQ,KAAK;CACrC,OAAO,OAAO,OAAO,SAAS;EAAE,QAAQ;EAAsB;CAAM,CAAC;AACvE;;;;;;;;;;;;;ACNA,SAAgBC,kBACd,SAAkB,KAAA,GACwC;CAC1D,MAAM,UAAU,QAAQ,OAAc,MAAM;CAE5C,QAAQ,OAAO,UAAU,KAAK;CAE9B,OAAO,OAAO,OAAO,SAAS;EAAE,QAAQ;EAAqB;CAAO,CAAC;AACvE;;;;;;;ACLA,MAAa,kBAAkBC;;;;;AAM/B,MAAa,kBAAkBC"}
package/package.json CHANGED
@@ -1,6 +1,168 @@
1
1
  {
2
2
  "name": "@vickbk/tests",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "0.2.0",
4
+ "description": "Testing helpers for Vitest and Playwright.",
5
+ "publishConfig": {
6
+ "access": "public"
7
+ },
8
+ "type": "module",
9
+ "license": "MIT",
10
+ "repository": {
11
+ "type": "git",
12
+ "url": "https://github.com/vickbk/tests.git"
13
+ },
14
+ "author": "Vick Bake <vickbake8@gmail.com>",
15
+ "keywords": [
16
+ "testing",
17
+ "vitest",
18
+ "playwright",
19
+ "utilities",
20
+ "helpers"
21
+ ],
22
+ "bugs": {
23
+ "url": "https://github.com/vickbk/tests/issues"
24
+ },
25
+ "homepage": "https://github.com/vickbk/tests#readme",
26
+ "main": "./dist/index.cjs",
27
+ "module": "./dist/index.mjs",
28
+ "types": "./dist/index.d.mts",
29
+ "files": [
30
+ "dist",
31
+ "README.md",
32
+ "LICENSE",
33
+ "CHANGELOG.md"
34
+ ],
35
+ "exports": {
36
+ ".": {
37
+ "import": {
38
+ "types": "./dist/index.d.mts",
39
+ "default": "./dist/index.mjs"
40
+ },
41
+ "require": {
42
+ "types": "./dist/index.d.cts",
43
+ "default": "./dist/index.cjs"
44
+ }
45
+ },
46
+ "./vitest": {
47
+ "import": {
48
+ "types": "./dist/vitest.d.mts",
49
+ "default": "./dist/vitest.mjs"
50
+ }
51
+ },
52
+ "./vitest/console": {
53
+ "import": {
54
+ "types": "./dist/vitest/console.d.mts",
55
+ "default": "./dist/vitest/console.mjs"
56
+ }
57
+ },
58
+ "./vitest/dom": {
59
+ "import": {
60
+ "types": "./dist/vitest/dom.d.mts",
61
+ "default": "./dist/vitest/dom.mjs"
62
+ }
63
+ },
64
+ "./promises": {
65
+ "import": {
66
+ "types": "./dist/promises.d.mts",
67
+ "default": "./dist/promises.mjs"
68
+ },
69
+ "require": {
70
+ "types": "./dist/promises.d.cts",
71
+ "default": "./dist/promises.cjs"
72
+ }
73
+ },
74
+ "./react": {
75
+ "import": {
76
+ "types": "./dist/react.d.mts",
77
+ "default": "./dist/react.mjs"
78
+ },
79
+ "require": {
80
+ "types": "./dist/react.d.cts",
81
+ "default": "./dist/react.cjs"
82
+ }
83
+ },
84
+ "./playwright": {
85
+ "import": {
86
+ "types": "./dist/playwright.d.mts",
87
+ "default": "./dist/playwright.mjs"
88
+ },
89
+ "require": {
90
+ "types": "./dist/playwright.d.cts",
91
+ "default": "./dist/playwright.cjs"
92
+ }
93
+ }
94
+ },
95
+ "engines": {
96
+ "node": ">=20"
97
+ },
98
+ "peerDependencies": {
99
+ "@playwright/test": "^1.64.1",
100
+ "@testing-library/jest-dom": "^7.0.1",
101
+ "@testing-library/react": "^16.0.0",
102
+ "@testing-library/user-event": "^14.6.8",
103
+ "@types/react": "^18.0.0 || ^19.0.0",
104
+ "react": "^18.0.0 || ^19.0.0",
105
+ "react-dom": "^18.0.0 || ^19.0.0",
106
+ "vitest": "^5.0.5"
107
+ },
108
+ "peerDependenciesMeta": {
109
+ "@playwright/test": {
110
+ "optional": true
111
+ },
112
+ "@testing-library/jest-dom": {
113
+ "optional": true
114
+ },
115
+ "@testing-library/react": {
116
+ "optional": true
117
+ },
118
+ "@testing-library/user-event": {
119
+ "optional": true
120
+ },
121
+ "@types/react": {
122
+ "optional": true
123
+ },
124
+ "react": {
125
+ "optional": true
126
+ },
127
+ "react-dom": {
128
+ "optional": true
129
+ },
130
+ "vitest": {
131
+ "optional": true
132
+ }
133
+ },
134
+ "devDependencies": {
135
+ "@playwright/test": "^1.64.1",
136
+ "@testing-library/jest-dom": "^7.0.1",
137
+ "@testing-library/react": "^16.0.0",
138
+ "@testing-library/user-event": "^14.6.8",
139
+ "@types/node": "^26.6.5",
140
+ "@types/react": "^19.0.0",
141
+ "@types/react-dom": "^19.0.0",
142
+ "@vickbk/ci-tools": "^0.2.1",
143
+ "@vitest/coverage-v8": "^5.0.5",
144
+ "eslint": "^10.13.0",
145
+ "eslint-import-resolver-typescript": "^4.4.5",
146
+ "eslint-plugin-boundaries": "^7.2.0",
147
+ "jsdom": "^30.1.3",
148
+ "react": "^19.0.0",
149
+ "react-dom": "^19.0.0",
150
+ "tsdown": "^0.23.1",
151
+ "tsx": "^4.23.13",
152
+ "typescript": "^6.0.0",
153
+ "typescript-eslint": "^8.72.0",
154
+ "vitest": "^5.0.5"
155
+ },
156
+ "scripts": {
157
+ "build": "tsdown",
158
+ "typecheck": "tsc --noEmit -p tsconfig.package.json",
159
+ "test": "vitest",
160
+ "lint": "eslint",
161
+ "release-note": "tsx ./src/bin/extract-release-note.ts",
162
+ "release-tag": "tsx ./src/bin/extract-version-tag.ts",
163
+ "test-comment": "tsx ./src/bin/post-vitest-coverage.ts",
164
+ "coverage-summary": "tsx ./src/bin/coverage-summary.ts",
165
+ "readme-check": "tsx ./src/bin/documentation/readme-check",
166
+ "readme-comment": "tsx ./src/bin/documentation/post-readme-comment"
167
+ }
6
168
  }