mirror of
https://github.com/garrytan/gstack.git
synced 2026-09-18 10:52:24 +02:00
test: adapt main's diagnostics tests to the merged designs
cli-lock asserts typed ServerLockError (errno + lock path) instead of the log-and-return shape the merge didn't keep, dropping only the one duplicate of server-lock-errors coverage; the liveness tripwire exempts error-handling.ts as the sanctioned tasklist site; snapshot and compare-board wrappers pass the now-mandatory browser-manager arg; background.js's test pins that the retired sidebar-command type is rejected pre-gate with no response fields.
This commit is contained in:
@@ -15,12 +15,20 @@ const SCRIPT = join(import.meta.dir, '..', '..', 'bin', 'gstack-config');
|
||||
let stateDir: string;
|
||||
|
||||
function run(args: string[] = [], extraEnv: Record<string, string> = {}) {
|
||||
// The script resolves its state dir as GSTACK_STATE_ROOT > GSTACK_HOME >
|
||||
// GSTACK_STATE_DIR > $HOME/.gstack. Strip the higher-precedence vars so a
|
||||
// stray value in the harness env (another test file's leftovers, operator
|
||||
// shell) can never outrank the per-test GSTACK_STATE_DIR isolation.
|
||||
const env: Record<string, string | undefined> = {
|
||||
...process.env,
|
||||
GSTACK_STATE_DIR: stateDir,
|
||||
};
|
||||
delete env.GSTACK_STATE_ROOT;
|
||||
delete env.GSTACK_HOME;
|
||||
Object.assign(env, extraEnv); // per-test overrides always win, deliberately
|
||||
|
||||
const result = Bun.spawnSync(['bash', SCRIPT, ...args], {
|
||||
env: {
|
||||
...process.env,
|
||||
GSTACK_STATE_DIR: stateDir,
|
||||
...extraEnv,
|
||||
},
|
||||
env,
|
||||
stdout: 'pipe',
|
||||
stderr: 'pipe',
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user