@adobe/aio-lib-web 6.1.0 → 6.1.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/aio-lib-web",
3
- "version": "6.1.0",
3
+ "version": "6.1.1",
4
4
  "description": "Utility tooling library to build and deploy Adobe I/O Project Firefly app static sites to CDN",
5
5
  "main": "index.js",
6
6
  "directories": {
@@ -22,11 +22,11 @@ const undeployWeb = async (config) => {
22
22
 
23
23
  const remoteStorage = new RemoteStorage(creds)
24
24
 
25
- if (!(await remoteStorage.folderExists(config.s3.folder))) {
25
+ if (!(await remoteStorage.folderExists(config.s3.folder + '/'))) {
26
26
  throw new Error(`cannot undeploy static files, there is no deployment for ${config.s3.folder}`)
27
27
  }
28
28
 
29
- await remoteStorage.emptyFolder(config.s3.folder)
29
+ await remoteStorage.emptyFolder(config.s3.folder + '/')
30
30
  }
31
31
 
32
32
  module.exports = undeployWeb
@@ -1,4 +1,3 @@
1
-
2
1
  const mockTvm = {
3
2
  init: jest.fn(async () => {
4
3
  return {
@@ -64,8 +64,8 @@ describe('undeploy-web', () => {
64
64
  await undeployWeb(config)
65
65
  expect(getS3Credentials).toHaveBeenCalledWith(config)
66
66
  expect(RemoteStorage).toHaveBeenCalledWith('fakecreds')
67
- expect(mockRemoteStorageInstance.folderExists).toHaveBeenCalledWith('somefolder')
68
- expect(mockRemoteStorageInstance.emptyFolder).toHaveBeenCalledWith('somefolder')
67
+ expect(mockRemoteStorageInstance.folderExists).toHaveBeenCalledWith('somefolder/')
68
+ expect(mockRemoteStorageInstance.emptyFolder).toHaveBeenCalledWith('somefolder/')
69
69
  })
70
70
 
71
71
  test('throws if remoteStorage folder does not exist', async () => {
@@ -89,7 +89,7 @@ describe('undeploy-web', () => {
89
89
  await expect(undeployWeb(config)).rejects.toThrow('cannot undeploy static files')
90
90
  expect(getS3Credentials).toHaveBeenCalledWith(config)
91
91
  expect(RemoteStorage).toHaveBeenCalledWith('fakecreds')
92
- expect(mockRemoteStorageInstance.folderExists).toHaveBeenCalledWith('somefolder')
92
+ expect(mockRemoteStorageInstance.folderExists).toHaveBeenCalledWith('somefolder/')
93
93
  expect(mockRemoteStorageInstance.emptyFolder).not.toHaveBeenCalled()
94
94
  })
95
95
  })