pluga-plg 0.2.0 → 0.2.1

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.
@@ -7,17 +7,6 @@ describe('Storage service', () => {
7
7
  const successResp = { success: true };
8
8
  let streamFileWriter;
9
9
 
10
- beforeEach(() => {
11
- client = {
12
- upload: jest.fn(),
13
- download: jest.fn(),
14
- fileExists: jest.fn(),
15
- getSignedUrl: jest.fn(),
16
- };
17
-
18
- service = new StorageService(client);
19
- });
20
-
21
10
  beforeEach(() => {
22
11
  client = {
23
12
  upload: jest.fn(),
@@ -50,7 +39,7 @@ describe('Storage service', () => {
50
39
  const stream = { fake: 'stream' };
51
40
  const expectedResult = { success: true };
52
41
 
53
- client.download.mockReturnValue({ stream });
42
+ client.download.mockResolvedValue({ stream });
54
43
  streamFileWriter.writeToDisk.mockResolvedValue(expectedResult);
55
44
 
56
45
  const result = await service.download(params);
@@ -15,7 +15,7 @@ class StorageService {
15
15
  }
16
16
 
17
17
  async download(params) {
18
- const { stream } = this.#client.download(params);
18
+ const { stream } = await this.#client.download(params);
19
19
  return this.#streamFileWriter.writeToDisk({ stream, ...params });
20
20
  }
21
21
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pluga-plg",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "Pluga developer platform toolbox",
5
5
  "main": "index.js",
6
6
  "author": "Pluga <tech@pluga.co> (pluga.co)",