tstyche 2.0.0-rc.2 → 2.1.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.
package/README.md CHANGED
@@ -59,6 +59,7 @@ test("handles numbers", () => {
59
59
  Here is the list of all matchers:
60
60
 
61
61
  - `.toBe()`, `.toBeAssignableTo()`, `.toBeAssignableWith()`, `.toMatch()` compare types or types of expression,
62
+ - `.toAcceptProps()` checks types of JSX component's props,
62
63
  - `.toHaveProperty()` looks up keys on an object type,
63
64
  - `.toRaiseError()` captures the type error message or code,
64
65
  - `.toBeString()`, `.toBeNumber()`, `.toBeVoid()` and 9 more shorthand checks for primitive types.
@@ -71,7 +72,7 @@ The `tstyche` command is the heart of TSTyche. For example, it can select test f
71
72
  tstyche JsonObject --only external --target 4.8,latest
72
73
  ```
73
74
 
74
- This simple!
75
+ This simple! (And it has the watch mode too.)
75
76
 
76
77
  ## Documentation
77
78
 
package/build/index.d.cts CHANGED
@@ -59,6 +59,31 @@ interface Test {
59
59
  todo: (name: string, callback?: () => void | Promise<void>) => void;
60
60
  }
61
61
  interface Matchers {
62
+ /**
63
+ * Checks if the JSX component accepts props of the given type.
64
+ *
65
+ * @remarks
66
+ *
67
+ * This is a work in progress feature. Generic components are not yet supported.
68
+ */
69
+ toAcceptProps: {
70
+ /**
71
+ * Checks if the JSX component accepts props of the given type.
72
+ *
73
+ * @remarks
74
+ *
75
+ * This is a work in progress feature. Generic components are not yet supported.
76
+ */
77
+ <Target>(): void;
78
+ /**
79
+ * Checks if the JSX component accepts the given props.
80
+ *
81
+ * @remarks
82
+ *
83
+ * This is a work in progress feature. Generic components are not yet supported.
84
+ */
85
+ (target: unknown): void;
86
+ };
62
87
  /**
63
88
  * Checks if the source type is identical to the target type.
64
89
  */
package/build/index.d.ts CHANGED
@@ -59,6 +59,31 @@ interface Test {
59
59
  todo: (name: string, callback?: () => void | Promise<void>) => void;
60
60
  }
61
61
  interface Matchers {
62
+ /**
63
+ * Checks if the JSX component accepts props of the given type.
64
+ *
65
+ * @remarks
66
+ *
67
+ * This is a work in progress feature. Generic components are not yet supported.
68
+ */
69
+ toAcceptProps: {
70
+ /**
71
+ * Checks if the JSX component accepts props of the given type.
72
+ *
73
+ * @remarks
74
+ *
75
+ * This is a work in progress feature. Generic components are not yet supported.
76
+ */
77
+ <Target>(): void;
78
+ /**
79
+ * Checks if the JSX component accepts the given props.
80
+ *
81
+ * @remarks
82
+ *
83
+ * This is a work in progress feature. Generic components are not yet supported.
84
+ */
85
+ (target: unknown): void;
86
+ };
62
87
  /**
63
88
  * Checks if the source type is identical to the target type.
64
89
  */