basant307/AI_Governance_Project
048
1import { afterEach, beforeEach, describe, expect, it } from 'vitest';2import path from 'node:path';3import { Storage } from '@qwen-code/qwen-code-core';4import { runWithAcpRuntimeOutputDir } from './runtimeOutputDirContext.js';5describe('runWithAcpRuntimeOutputDir', () => {6 beforeEach(() => {7 Storage.setRuntimeBaseDir(null);8 delete process.env['QWEN_RUNTIME_DIR'];9 });10 afterEach(() => {11 Storage.setRuntimeBaseDir(null);12 delete process.env['QWEN_RUNTIME_DIR'];13 });14 it('uses the merged runtimeOutputDir relative to cwd within the async context', async () => {15 const cwd = path.resolve('workspace', 'project-a');16 const settings = {17 merged: {18 advanced: {19 runtimeOutputDir: '.qwen-runtime',20 },21 },22 };23 await runWithAcpRuntimeOutputDir(settings, cwd, async () => {24 expect(Storage.getRuntimeBaseDir()).toBe(path.join(cwd, '.qwen-runtime'));25 });26 expect(Storage.getRuntimeBaseDir()).toBe(Storage.getGlobalQwenDir());27 });28});29//# sourceMappingURL=runtimeOutputDirContext.test.js.map