Skip to content

Commit

Permalink
also add a negative test
Browse files Browse the repository at this point in the history
  • Loading branch information
foxriver76 committed Jan 8, 2025
1 parent ff568fd commit 3a2f0c0
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions packages/controller/test/lib/testFiles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,15 @@ export function register(it: Mocha.TestFunction, expect: Chai.ExpectStatic, cont
expect(res).to.be.empty;
});

it(`${testName}should not read directory without meta object`, () => {
const objects = context.objects;
const id = `${testId}.meta.nonExisting`;

expect(objects.readDirAsync(id, '')).to.be.eventually.rejectedWith(
new Error(`${id} is not an object of type "meta"`),
);
});

it(`${testName}should respond with empty array if calling readDir on a single file`, async () => {
const objects = context.objects;
const fileName = 'dir/notADir.txt';
Expand Down

0 comments on commit 3a2f0c0

Please sign in to comment.