@quilted/quilt 0.6.0 → 0.6.2

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 (31) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/build/esm/graphql/testing/matchers/operations.mjs +2 -2
  3. package/build/esm/graphql/testing/matchers/utilities.mjs +1 -1
  4. package/build/esm/react/testing.mjs +1 -1
  5. package/build/esnext/graphql/testing/matchers/operations.esnext +4 -6
  6. package/build/esnext/graphql/testing/matchers/utilities.esnext +1 -1
  7. package/build/esnext/react/testing.esnext +1 -1
  8. package/build/tsconfig.tsbuildinfo +1 -1
  9. package/build/typescript/assets/files.d.ts +97 -0
  10. package/build/typescript/assets/files.d.ts.map +1 -0
  11. package/build/typescript/assets/styles.d.ts +11 -0
  12. package/build/typescript/assets/styles.d.ts.map +1 -0
  13. package/build/typescript/assets.d.ts +2 -0
  14. package/build/typescript/assets.d.ts.map +1 -1
  15. package/build/typescript/globals.d.ts +2 -0
  16. package/build/typescript/globals.d.ts.map +1 -1
  17. package/build/typescript/graphql/testing/matchers/operations.d.ts +2 -2
  18. package/build/typescript/graphql/testing/matchers/operations.d.ts.map +1 -1
  19. package/build/typescript/graphql/testing/matchers/utilities.d.ts +1 -0
  20. package/build/typescript/graphql/testing/matchers/utilities.d.ts.map +1 -1
  21. package/build/typescript/react/testing.d.ts +3 -3
  22. package/build/typescript/react/testing.d.ts.map +1 -1
  23. package/package.json +1 -1
  24. package/source/assets/files.ts +129 -0
  25. package/source/assets/styles.ts +9 -0
  26. package/source/assets.ts +3 -0
  27. package/source/globals.ts +2 -0
  28. package/source/graphql/testing/matchers/operations.ts +10 -8
  29. package/source/graphql/testing/matchers/utilities.ts +1 -1
  30. package/source/react/testing.ts +3 -7
  31. package/tsconfig.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # @quilted/quilt
2
2
 
3
+ ## 0.6.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [`4bf3e6ad`](https://github.com/lemonmade/quilt/commit/4bf3e6ade2922fe5de175b07fdaf21bb679895bf) Thanks [@lemonmade](https://github.com/lemonmade)! - Fix custom matcher equality testing
8
+
9
+ - [`4df2d665`](https://github.com/lemonmade/quilt/commit/4df2d665ae22201afa86e7a5f214f73f5428ea4e) Thanks [@lemonmade](https://github.com/lemonmade)! - Fix React testing exports
10
+
11
+ ## 0.6.1
12
+
13
+ ### Patch Changes
14
+
15
+ - [`e407aec5`](https://github.com/lemonmade/quilt/commit/e407aec56e697eadfc7b1e62168ad40a49738d96) Thanks [@lemonmade](https://github.com/lemonmade)! - Dissolve TypeScript package between craft and quilt
16
+
3
17
  ## 0.6.0
4
18
 
5
19
  ### Minor Changes
@@ -1,6 +1,6 @@
1
1
  import { matcherHint, EXPECTED_COLOR, printExpected } from 'jest-matcher-utils';
2
2
  import { normalizeOperation } from '@quilted/graphql/ast';
3
- import { assertIsGraphQLController, diffVariables } from './utilities.mjs';
3
+ import { assertIsGraphQLController, getObjectSubset, diffVariables } from './utilities.mjs';
4
4
 
5
5
  function toHavePerformedGraphQLOperation(graphql, operation, variables) {
6
6
  assertIsGraphQLController(graphql, {
@@ -10,7 +10,7 @@ function toHavePerformedGraphQLOperation(graphql, operation, variables) {
10
10
  const foundByOperation = graphql.completed.all({
11
11
  operation
12
12
  });
13
- const foundByVariables = variables == null ? foundByOperation : foundByOperation.filter(operation => Object.keys(variables).every(key => Object.is(variables[key], (operation.variables ?? {})[key])));
13
+ const foundByVariables = variables == null ? foundByOperation : foundByOperation.filter(operation => this.equals(variables, getObjectSubset(operation.variables, variables)));
14
14
  const pass = foundByVariables.length > 0;
15
15
  const {
16
16
  name
@@ -37,4 +37,4 @@ function getObjectSubset(object, subset) {
37
37
  return object;
38
38
  }
39
39
 
40
- export { assertIsGraphQLController, diffVariables };
40
+ export { assertIsGraphQLController, diffVariables, getObjectSubset };
@@ -1,6 +1,6 @@
1
1
  import { expect } from 'vitest';
2
2
  import { matchers } from '@quilted/react-testing/matchers';
3
- export { createRender, destroyAll, render, rendered } from '@quilted/react-testing';
3
+ export { createRender, destroyAll, render, rendered } from '@quilted/react-testing/preact';
4
4
 
5
5
  // @ts-expect-error Incompatibilities between `expect()` and vitest
6
6
  expect.extend(matchers);
@@ -1,6 +1,6 @@
1
1
  import { matcherHint, EXPECTED_COLOR, printExpected } from 'jest-matcher-utils';
2
2
  import { normalizeOperation } from '@quilted/graphql/ast';
3
- import { assertIsGraphQLController, diffVariables } from './utilities.esnext';
3
+ import { assertIsGraphQLController, getObjectSubset, diffVariables } from './utilities.esnext';
4
4
 
5
5
  function toHavePerformedGraphQLOperation(graphql, operation, variables) {
6
6
  assertIsGraphQLController(graphql, {
@@ -11,11 +11,9 @@ function toHavePerformedGraphQLOperation(graphql, operation, variables) {
11
11
  operation
12
12
  });
13
13
  const foundByVariables = variables == null ? foundByOperation : foundByOperation.filter(
14
- (operation2) => Object.keys(variables).every(
15
- (key) => Object.is(
16
- variables[key],
17
- (operation2.variables ?? {})[key]
18
- )
14
+ (operation2) => this.equals(
15
+ variables,
16
+ getObjectSubset(operation2.variables, variables)
19
17
  )
20
18
  );
21
19
  const pass = foundByVariables.length > 0;
@@ -40,4 +40,4 @@ function getObjectSubset(object, subset) {
40
40
  return object;
41
41
  }
42
42
 
43
- export { assertIsGraphQLController, diffVariables };
43
+ export { assertIsGraphQLController, diffVariables, getObjectSubset };
@@ -1,5 +1,5 @@
1
1
  import { expect } from 'vitest';
2
2
  import { matchers } from '@quilted/react-testing/matchers';
3
- export { createRender, destroyAll, render, rendered } from '@quilted/react-testing';
3
+ export { createRender, destroyAll, render, rendered } from '@quilted/react-testing/preact';
4
4
 
5
5
  expect.extend(matchers);