tstyche 7.0.0-beta.4 → 7.0.0-beta.5

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/api.js CHANGED
@@ -4626,9 +4626,6 @@ class ToAcceptProps {
4626
4626
  if (!sourceProperty) {
4627
4627
  return false;
4628
4628
  }
4629
- if (this.#isOptionalProperty(targetProperty) && !this.#isOptionalProperty(sourceProperty)) {
4630
- return false;
4631
- }
4632
4629
  const targetPropertyType = this.#typeChecker.getTypeOfSymbol(targetProperty);
4633
4630
  const sourcePropertyType = this.#typeChecker.getTypeOfSymbol(sourceProperty);
4634
4631
  if (!this.#typeChecker.isTypeAssignableTo(targetPropertyType, sourcePropertyType)) {
@@ -4671,15 +4668,6 @@ class ToAcceptProps {
4671
4668
  diagnostics.push(diagnostic.extendWith(text, origin));
4672
4669
  continue;
4673
4670
  }
4674
- if (this.#isOptionalProperty(targetProperty) && !this.#isOptionalProperty(sourceProperty)) {
4675
- const text = [
4676
- ExpectDiagnosticText.isNotAssignableFrom(sourceTypeText, targetTypeText),
4677
- ExpectDiagnosticText.requiresProperty(sourceTypeText, targetPropertyName),
4678
- ];
4679
- const origin = matchWorker.resolveDiagnosticOrigin(targetProperty, targetNode);
4680
- diagnostics.push(diagnostic.extendWith(text, origin));
4681
- continue;
4682
- }
4683
4671
  const targetPropertyType = this.#typeChecker.getTypeOfSymbol(targetProperty);
4684
4672
  const sourcePropertyType = this.#typeChecker.getTypeOfSymbol(sourceProperty);
4685
4673
  if (!this.#typeChecker.isTypeAssignableTo(targetPropertyType, sourcePropertyType)) {
@@ -4747,9 +4735,7 @@ class ToAcceptProps {
4747
4735
  const targetType = matchWorker.getType(targetNode);
4748
4736
  if (!(targetType.flags & this.#compiler.TypeFlags.Object)) {
4749
4737
  const expectedText = "of an object type";
4750
- const text = nodeBelongsToArgumentList(this.#compiler, targetNode)
4751
- ? ExpectDiagnosticText.argumentMustBe("target", expectedText)
4752
- : ExpectDiagnosticText.typeArgumentMustBe("Target", expectedText);
4738
+ const text = ExpectDiagnosticText.argumentMustBe("props", expectedText);
4753
4739
  const origin = DiagnosticOrigin.fromNode(targetNode);
4754
4740
  diagnostics.push(Diagnostic.error(text, origin));
4755
4741
  }
@@ -6179,7 +6165,7 @@ class FileRunner {
6179
6165
  class Runner {
6180
6166
  #eventEmitter = new EventEmitter();
6181
6167
  #resolvedConfig;
6182
- static version = "7.0.0-beta.4";
6168
+ static version = "7.0.0-beta.5";
6183
6169
  constructor(resolvedConfig) {
6184
6170
  this.#resolvedConfig = resolvedConfig;
6185
6171
  }
package/dist/index.d.cts CHANGED
@@ -74,16 +74,7 @@ interface Matchers {
74
74
  /**
75
75
  * Checks if the JSX component accepts the given props.
76
76
  */
77
- toAcceptProps: {
78
- /**
79
- * Checks if the JSX component accepts props of the given type.
80
- */
81
- <Target>(): void;
82
- /**
83
- * Checks if the JSX component accepts the given props.
84
- */
85
- (target: unknown): void;
86
- };
77
+ toAcceptProps: (props: Record<string, unknown>) => void;
87
78
  /**
88
79
  * Checks if the decorator is applicable to the given class or class member.
89
80
  */
@@ -104,8 +95,12 @@ interface Matchers {
104
95
  * Checks if the type has the given property.
105
96
  */
106
97
  toHaveProperty: (key: string | number | symbol) => void;
98
+ }
99
+ interface Matchers {
107
100
  /**
108
101
  * Checks if the type raises an error.
102
+ *
103
+ * @deprecated This matcher is planned to be removed. For a replacement, see https://tstyche.org/guides/expect-errors.
109
104
  */
110
105
  toRaiseError: (...target: Array<string | number | RegExp>) => void;
111
106
  }
package/dist/index.d.ts CHANGED
@@ -74,16 +74,7 @@ interface Matchers {
74
74
  /**
75
75
  * Checks if the JSX component accepts the given props.
76
76
  */
77
- toAcceptProps: {
78
- /**
79
- * Checks if the JSX component accepts props of the given type.
80
- */
81
- <Target>(): void;
82
- /**
83
- * Checks if the JSX component accepts the given props.
84
- */
85
- (target: unknown): void;
86
- };
77
+ toAcceptProps: (props: Record<string, unknown>) => void;
87
78
  /**
88
79
  * Checks if the decorator is applicable to the given class or class member.
89
80
  */
@@ -104,8 +95,12 @@ interface Matchers {
104
95
  * Checks if the type has the given property.
105
96
  */
106
97
  toHaveProperty: (key: string | number | symbol) => void;
98
+ }
99
+ interface Matchers {
107
100
  /**
108
101
  * Checks if the type raises an error.
102
+ *
103
+ * @deprecated This matcher is planned to be removed. For a replacement, see https://tstyche.org/guides/expect-errors.
109
104
  */
110
105
  toRaiseError: (...target: Array<string | number | RegExp>) => void;
111
106
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tstyche",
3
- "version": "7.0.0-beta.4",
3
+ "version": "7.0.0-beta.5",
4
4
  "description": "Everything You Need for Type Testing.",
5
5
  "keywords": [
6
6
  "typescript",