@xylabs/vitest-extended 5.0.83 → 5.0.86

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/README.md CHANGED
@@ -15,6 +15,8 @@
15
15
 
16
16
  Base functionality used throughout XY Labs TypeScript/JavaScript libraries
17
17
 
18
+
19
+
18
20
  ## Reference
19
21
 
20
22
  **@xylabs/vitest-extended**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xylabs/vitest-extended",
3
- "version": "5.0.83",
3
+ "version": "5.0.86",
4
4
  "description": "Base functionality used throughout XY Labs TypeScript/JavaScript libraries",
5
5
  "keywords": [
6
6
  "log",
@@ -43,11 +43,11 @@
43
43
  "types.d.ts"
44
44
  ],
45
45
  "dependencies": {
46
- "@xylabs/vitest-matchers": "~5.0.83"
46
+ "@xylabs/vitest-matchers": "~5.0.86"
47
47
  },
48
48
  "devDependencies": {
49
- "@xylabs/ts-scripts-yarn3": "~7.4.11",
50
- "@xylabs/tsconfig": "~7.4.11",
49
+ "@xylabs/ts-scripts-yarn3": "~7.4.16",
50
+ "@xylabs/tsconfig": "~7.4.16",
51
51
  "typescript": "~5.9.3",
52
52
  "vitest": "~4.0.18"
53
53
  },
@@ -1,26 +1,47 @@
1
1
  // vitest.customMatchers.d.ts
2
2
  import 'vitest'
3
3
 
4
+ /** Custom matcher methods available on Vitest's `expect` when using `@xylabs/vitest-extended`. */
4
5
  interface CustomMatchers<T = unknown> {
6
+ /** Asserts the value is an array. */
5
7
  toBeArray(): T
8
+ /** Asserts the value is an array with the specified length. */
6
9
  toBeArrayOfSize(size: number): T
10
+ /** Asserts the value is empty (zero-length array/string, empty object, Map, or Set). */
7
11
  toBeEmpty(): T
12
+ /** Asserts the value is strictly `false`. */
8
13
  toBeFalse(): T
14
+ /** Asserts the value is of type `function`. */
9
15
  toBeFunction(): T
16
+ /** Asserts the value is an integer. */
10
17
  toBeInteger(): T
18
+ /** Asserts the value is a negative number. */
11
19
  toBeNegative(): T
20
+ /** Asserts the value is of type `number` and not NaN. */
12
21
  toBeNumber(): T
22
+ /** Asserts the value is a plain object (not an array or null). */
13
23
  toBeObject(): T
24
+ /** Asserts the value is one of the values in the provided array. */
14
25
  toBeOneOf(expected: unknown[]): T
26
+ /** Asserts the value is a positive number. */
15
27
  toBePositive(): T
28
+ /** Asserts the value is of type `string`. */
16
29
  toBeString(): T
30
+ /** Asserts the value is strictly `true`. */
17
31
  toBeTrue(): T
32
+ /** Asserts the value is a valid Date instance. */
18
33
  toBeValidDate(): T
34
+ /** Asserts the object contains all of the specified keys. */
19
35
  toContainAllKeys(expectedKeys: string[]): T
36
+ /** Asserts that all expected values are present in the object's values. */
20
37
  toContainAllValues(expectedValues: unknown[]): T
38
+ /** Asserts the object contains the specified key. */
21
39
  toContainKey(key: string): T
40
+ /** Asserts the object contains all of the specified values (using deep equality). */
22
41
  toContainValues(expectedValues: unknown[]): T
42
+ /** Asserts the array, string, or object values include the specified value. */
23
43
  toInclude(expected: unknown): T
44
+ /** Asserts the array includes all members of the expected array. */
24
45
  toIncludeAllMembers(expected: unknown[]): T
25
46
  }
26
47