Skip to content

Commit 212f454

Browse files
committed
test(drivers): make searched-root assertion deterministic
1 parent f57e73d commit 212f454

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

‎packages/drivers/test/resolve-unit.test.ts‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,9 @@ describe("loadOptionalDriver", () => {
313313
})
314314

315315
test("throws DriverNotInstalledError naming the searched roots", async () => {
316-
process.env["ALTIMATE_DRIVER_DIR"] = path.join(tmpRoot, "empty")
316+
const managedRoot = path.join(tmpRoot, "empty", "node_modules")
317+
fs.mkdirSync(managedRoot, { recursive: true })
318+
process.env["ALTIMATE_DRIVER_DIR"] = path.dirname(managedRoot)
317319
delete process.env["ALTIMATE_BIN_DIR"]
318320
delete process.env["NODE_PATH"]
319321

@@ -332,6 +334,7 @@ describe("loadOptionalDriver", () => {
332334
// target directory and no account of where we had looked.
333335
expect(err.message).toContain("--prefix")
334336
expect(err.message).toContain("Searched")
337+
expect(err.message).toContain(managedRoot)
335338
})
336339

337340
test("reports a disk-resolved package that throws on import as a load failure", async () => {

0 commit comments

Comments
 (0)