ignore: rework bootstrap so server lazy starts it

This commit is contained in:
Dax Raad
2025-09-19 05:11:29 -04:00
parent 0e19ca21ed
commit ae6154e1c3
13 changed files with 690 additions and 637 deletions

View File

@@ -20,38 +20,47 @@ const fixturePath = path.join(__dirname, "../fixtures/example")
describe("tool.glob", () => {
test("truncate", async () => {
await Instance.provide(projectRoot, async () => {
let result = await glob.execute(
{
pattern: "**/*",
path: "../../node_modules",
},
ctx,
)
expect(result.metadata.truncated).toBe(true)
await Instance.provide({
directory: projectRoot,
fn: async () => {
let result = await glob.execute(
{
pattern: "**/*",
path: "../../node_modules",
},
ctx,
)
expect(result.metadata.truncated).toBe(true)
},
})
})
test("basic", async () => {
await Instance.provide(projectRoot, async () => {
let result = await glob.execute(
{
pattern: "*.json",
path: undefined,
},
ctx,
)
expect(result.metadata).toMatchObject({
truncated: false,
count: 2,
})
await Instance.provide({
directory: projectRoot,
fn: async () => {
let result = await glob.execute(
{
pattern: "*.json",
path: undefined,
},
ctx,
)
expect(result.metadata).toMatchObject({
truncated: false,
count: 2,
})
},
})
})
})
describe("tool.ls", () => {
test("basic", async () => {
const result = await Instance.provide(projectRoot, async () => {
return await list.execute({ path: fixturePath, ignore: [".git"] }, ctx)
const result = await Instance.provide({
directory: projectRoot,
fn: async () => {
return await list.execute({ path: fixturePath, ignore: [".git"] }, ctx)
},
})
// Normalize absolute path to relative for consistent snapshots