Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bun Glob .match does not match **/*name* to any file paths #16878

Closed
colelawrence opened this issue Jan 29, 2025 · 0 comments
Closed

Bun Glob .match does not match **/*name* to any file paths #16878

colelawrence opened this issue Jan 29, 2025 · 0 comments
Labels
bug Something isn't working needs triage

Comments

@colelawrence
Copy link

What version of Bun is running?

1.2.0+b0c5a7655

What platform is your computer?

Darwin 24.1.0 arm64 arm

What steps can reproduce the bug?

Run this test.

import { expect, it } from "vitest";

it("glob matches", () => {
  expect(new Bun.Glob("/**/*typescript*").match("/Users/cole/dev/project1/apps/editor/src/typescript-context.md")).toBe(true);
});

What is the expected behavior?

I expect **/*somestring* to behave like simply checking if the last part of the path contains "somestring"

What do you see instead?

It does not match

tools/bun-assumptions.test.mts:
1 | import { expect, it } from "vitest";
2 | 
3 | it("glob matches", () => {
4 |   expect(new Bun.Glob("/**/*typescript*").match("/Users/cole/dev/project1/apps/editor/src/typescript-context.md")).toBe(
                                                                                                                       ^
error: expect(received).toBe(expected)

Expected: true
Received: false

Additional information

No response

@colelawrence colelawrence added bug Something isn't working needs triage labels Jan 29, 2025
@RiskyMH RiskyMH closed this as completed Jan 29, 2025
@colelawrence colelawrence changed the title Bun Glob does not match **/*name* to any file paths Bun Glob .match does not match **/*name* to any file paths Jan 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs triage
Projects
None yet
Development

No branches or pull requests

2 participants