Files
Genarrative/apps/ai-game-creator-shell/src-tauri/tests/fixtures/environment-probe.cjs
T
lhk229 172ef2a16b
Project CI / AI game creator shell Rust lane 2/2 (pull_request) Has been cancelled
Project CI / Backend tests (pull_request) Has been cancelled
Project CI / Native shell tests (pull_request) Has been cancelled
Project CI / Frontend tests (pull_request) Has been cancelled
Project CI / Repository checks (pull_request) Has been cancelled
Project CI / AI game creator shell Rust crates (pull_request) Has been cancelled
Project CI / AI game creator shell web tests (pull_request) Has been cancelled
Project CI / AI game creator shell Rust lane 1/2 (pull_request) Has been cancelled
Project CI / AI game creator shell Rust smoke (pull_request) Has been cancelled
修复环境探测测试夹具触发配置检查的问题
将 Node 环境断言移入独立测试夹具并通过 include_str 引用
保持生产配置检查规则与预检实现不变
同步定向验证入口说明
2026-09-28 23:24:52 +08:00

21 lines
762 B
JavaScript

const assert = require('node:assert/strict');
const fs = require('node:fs');
const path = require('node:path');
const home = process.env.HOME;
assert.ok(home && fs.statSync(home).isDirectory());
for (const key of ['USERPROFILE', 'APPDATA', 'LOCALAPPDATA']) {
assert.equal(process.env[key], home);
}
assert.equal(fs.realpathSync(process.cwd()), fs.realpathSync(home));
assert.equal(
fs.realpathSync(require('node:os').homedir()),
fs.realpathSync(home),
);
for (const key of ['npm_config_userconfig', 'npm_config_globalconfig']) {
assert.equal(path.dirname(process.env[key]), home);
assert.equal(fs.readFileSync(process.env[key], 'utf8'), '');
}
assert.equal(process.env.npm_config_cache, path.join(home, 'npm-cache'));
process.stdout.write('1.0.0\n');