@roc-db/test-utils 0.2.0-pre.63 → 0.2.0-pre.65

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 (2) hide show
  1. package/dist/index.js +19 -0
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -865,6 +865,25 @@ var testAdapterImplementation = async (adapterConstructor, generateArgs) => {
865
865
  const [{ persistedAt, ...mutation }] = await adapter2.persistOptimisticMutations([createPostMutation]);
866
866
  expect2(mutation).toStrictEqual(createPostMutation);
867
867
  });
868
+ test("sync mutation with debounce > 0", async () => {
869
+ const [post2, createPostMutation2] = await adapter1.createPost({
870
+ title: "Foo"
871
+ });
872
+ const [{ persistedAt, ...mutation }] = await adapter2.persistOptimisticMutations([createPostMutation2]);
873
+ expect2(mutation).toStrictEqual(createPostMutation2);
874
+ const res = await adapter1.updatePostTitle({
875
+ ref: post2.ref,
876
+ title: "A"
877
+ });
878
+ const [, debounceMutation] = await adapter1.updatePostTitle({
879
+ ref: post2.ref,
880
+ title: "A"
881
+ });
882
+ expect2(debounceMutation.debounceCount).toBe(1);
883
+ const [debounceMutationPersist] = await adapter2.persistOptimisticMutations([debounceMutation]);
884
+ expect2(debounceMutationPersist.debounceCount).toBe(1);
885
+ expect2(debounceMutationPersist.persistedAt).toBeDefined();
886
+ });
868
887
  test("create, patch and delete the same item within the same transaction", async () => {
869
888
  const [post1] = await adapter1.createPost({ title: "Post 1" });
870
889
  const [post2] = await adapter1.createPost({ title: "Post 1" });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@roc-db/test-utils",
3
- "version": "0.2.0-pre.63",
3
+ "version": "0.2.0-pre.65",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -17,7 +17,7 @@
17
17
  ],
18
18
  "sideEffects": false,
19
19
  "peerDependencies": {
20
- "roc-db": "0.2.0-pre.63",
20
+ "roc-db": "0.2.0-pre.65",
21
21
  "zod": "3.24.2"
22
22
  },
23
23
  "keywords": [],