@novasamatech/handoff-service 0.8.10 → 0.8.12

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.
@@ -42,7 +42,7 @@ describe('file loader', () => {
42
42
  const { client } = createMockHopClient();
43
43
  const data = new TextEncoder().encode('hello world');
44
44
  const uploadResult = await uploadFile({ data, hopClient: client });
45
- expect(uploadResult.isOk()).toBe(true);
45
+ await expect(uploadResult).toBeOk();
46
46
  const { identifier, claimTicket } = uploadResult._unsafeUnwrap();
47
47
  expect(identifier.length).toBe(32);
48
48
  expect(claimTicket.length).toBe(32);
@@ -51,8 +51,7 @@ describe('file loader', () => {
51
51
  claimTicket,
52
52
  hopClient: client,
53
53
  });
54
- expect(downloadResult.isOk()).toBe(true);
55
- expect(downloadResult._unsafeUnwrap()).toEqual(data);
54
+ await expect(downloadResult).toBeOkWith(data);
56
55
  });
57
56
  it('uploads and downloads a multi-chunk file', async () => {
58
57
  const { client } = createMockHopClient();
@@ -62,15 +61,14 @@ describe('file loader', () => {
62
61
  hopClient: client,
63
62
  chunkSize: 2_000,
64
63
  });
65
- expect(uploadResult.isOk()).toBe(true);
64
+ await expect(uploadResult).toBeOk();
66
65
  const { identifier, claimTicket } = uploadResult._unsafeUnwrap();
67
66
  const downloadResult = await downloadFile({
68
67
  identifier,
69
68
  claimTicket,
70
69
  hopClient: client,
71
70
  });
72
- expect(downloadResult.isOk()).toBe(true);
73
- expect(downloadResult._unsafeUnwrap()).toEqual(data);
71
+ await expect(downloadResult).toBeOkWith(data);
74
72
  });
75
73
  it('reports upload progress', async () => {
76
74
  const { client } = createMockHopClient();
@@ -111,14 +109,13 @@ describe('file loader', () => {
111
109
  const { client } = createMockHopClient();
112
110
  const data = new Uint8Array(0);
113
111
  const uploadResult = await uploadFile({ data, hopClient: client });
114
- expect(uploadResult.isOk()).toBe(true);
112
+ await expect(uploadResult).toBeOk();
115
113
  const { identifier, claimTicket } = uploadResult._unsafeUnwrap();
116
114
  const downloadResult = await downloadFile({
117
115
  identifier,
118
116
  claimTicket,
119
117
  hopClient: client,
120
118
  });
121
- expect(downloadResult.isOk()).toBe(true);
122
- expect(downloadResult._unsafeUnwrap()).toEqual(data);
119
+ await expect(downloadResult).toBeOkWith(data);
123
120
  });
124
121
  });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@novasamatech/handoff-service",
3
3
  "type": "module",
4
- "version": "0.8.10",
4
+ "version": "0.8.12",
5
5
  "description": "HOP (Handoff Pool) file transfer service for P2P chat",
6
6
  "license": "Apache-2.0",
7
7
  "repository": {