-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: bun error on calling
jsr add
twice (#36)
* fix: second `jsr add` fails * refactor: use regexp * feat: add test code * chore: format code
- Loading branch information
Showing
2 changed files
with
14 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -300,6 +300,19 @@ describe("install", () => { | |
}, | ||
); | ||
}); | ||
it("jsr add --bun @std/[email protected] - forces bun for twice", async () => { | ||
await withTempEnv( | ||
["i", "--bun", "@std/[email protected]"], | ||
async (_, dir) => { | ||
await runJsr(["i", "--bun", "@std/[email protected]"], dir); | ||
const config = await fs.promises.readFile( | ||
path.join(dir, "bunfig.toml"), | ||
"utf-8", | ||
); | ||
assert.match(config, /"@jsr"\s+=/, "bunfig.toml not created"); | ||
}, | ||
); | ||
}); | ||
} | ||
|
||
describe("env detection", () => { | ||
|