mobiletto 1.0.38 → 1.0.39
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/index.js +1 -1
- package/package.json +1 -1
- package/test/index.spec.js +8 -0
package/index.js
CHANGED
|
@@ -349,7 +349,7 @@ async function mobiletto (driverPath, key, secret, opts, encryption = null) {
|
|
|
349
349
|
|
|
350
350
|
const encClient = {
|
|
351
351
|
list: async (pth = '', recursive, visitor) => {
|
|
352
|
-
const p = pth === '' ? '.' : pth
|
|
352
|
+
const p = pth === '' ? '.' : pth.endsWith('/') ? pth.substring(0, pth.length - 1) : pth
|
|
353
353
|
const dirent = direntDir(p)
|
|
354
354
|
let entries
|
|
355
355
|
try {
|
package/package.json
CHANGED
package/test/index.spec.js
CHANGED
|
@@ -310,6 +310,14 @@ for (const driverName of DRIVER_NAMES) {
|
|
|
310
310
|
expect(baseListing).to.have.lengthOf.greaterThanOrEqual(1)
|
|
311
311
|
expect(baseListing.find(o => o.name === path.dirname(randomParent))).to.not.be.null
|
|
312
312
|
})
|
|
313
|
+
it("should successfully list files in a subdirectory", async () => {
|
|
314
|
+
const listing = await fixture.api.list(randomParent)
|
|
315
|
+
expect(listing).to.have.lengthOf.greaterThanOrEqual(1)
|
|
316
|
+
})
|
|
317
|
+
it("should successfully list files in a subdirectory ending with a slash", async () => {
|
|
318
|
+
const listing = await fixture.api.list(randomParent+'/')
|
|
319
|
+
expect(listing).to.have.lengthOf.greaterThanOrEqual(1)
|
|
320
|
+
})
|
|
313
321
|
it("should load metadata for one of the new files", async () => {
|
|
314
322
|
await assertMeta(fixture.api, fixture.name, READ_SZ, encryption ? ENC_SIZE_CLOSE_ENOUGH_PERCENT : null)
|
|
315
323
|
})
|