Skip to content

Commit

Permalink
add specs
Browse files Browse the repository at this point in the history
  • Loading branch information
webpro committed Dec 18, 2024
1 parent d51e2b9 commit 882e3c7
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions test/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -364,3 +364,18 @@ test('sync with empty array matches nothing', () => {
const files = globSync({ patterns: [] });
assert.deepEqual(files.sort(), []);
});

test('*', async () => {
const files = await glob({ patterns: ['./*'], cwd, onlyDirectories: true, expandDirectories: false });
assert.deepEqual(files.sort(), ['a/', 'b/']);
});

test('.a/*', async () => {
const files = await glob({ patterns: ['.a/*'], cwd, onlyDirectories: true, expandDirectories: false });
assert.deepEqual(files.sort(), ['.a/a/']);
});

test('. + .a/*', async () => {
const files = await glob({ patterns: ['.', '.a/*'], cwd, onlyDirectories: true, expandDirectories: false });
assert.deepEqual(files.sort(), ['.', '.a/a/']);
});

0 comments on commit 882e3c7

Please sign in to comment.