test(core): disable npm audits in the test preload (#47170)

Co-authored-by: Hona <10430890+Hona@users.noreply.github.com>
Co-authored-by: rekram1-node <rekram1-node@users.noreply.github.com>
This commit is contained in:
opencode-agent[bot] 2026-09-03 19:52:18 -05:00 committed by GitHub
parent e536b9627e
commit d431fedce5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 5 additions and 0 deletions

View file

@ -4,6 +4,10 @@ import path from "path"
import { Global } from "@opencode-ai/util/global"
describe("Core test environment", () => {
test("disables public npm security audits", () => {
expect(process.env.NPM_CONFIG_AUDIT).toBe("false")
})
test("isolates global home and XDG roots", () => {
const home = process.env.OPENCODE_TEST_HOME
expect(home).toBeDefined()

View file

@ -1 +1,2 @@
process.env.OPENCODE_DB = ":memory:"
process.env.NPM_CONFIG_AUDIT = "false"