Path: blob/main/src/vs/sessions/test/common/agentHostSessionsProvider.test.ts
13394 views
/*---------------------------------------------------------------------------------------------1* Copyright (c) Microsoft Corporation. All rights reserved.2* Licensed under the MIT License. See License.txt in the project root for license information.3*--------------------------------------------------------------------------------------------*/45import assert from 'assert';6import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../base/test/common/utils.js';7import { buildMutableConfigSchema } from '../../common/agentHostSessionsProvider.js';89suite('buildMutableConfigSchema', () => {1011ensureNoDisposablesAreLeakedInTestSuite();1213test('derives per-value schema entries and special-cases autoApprove', () => {14const actual = buildMutableConfigSchema({15autoApprove: 'default',16mode: 'worktree',17timeout: 5000,18enabled: true,19tags: ['a', 'b'],20permissions: { allow: ['Tool'], deny: [] },21nothing: undefined,22missing: null,23});2425assert.deepStrictEqual(actual, {26autoApprove: {27type: 'string',28title: 'autoApprove',29sessionMutable: true,30enum: ['default', 'autoApprove', 'autopilot'],31},32mode: {33type: 'string',34title: 'mode',35sessionMutable: true,36enum: ['worktree'],37},38timeout: { type: 'number', title: 'timeout', sessionMutable: true },39enabled: { type: 'boolean', title: 'enabled', sessionMutable: true },40tags: { type: 'array', title: 'tags', sessionMutable: true },41permissions: { type: 'object', title: 'permissions', sessionMutable: true },42// `undefined` and `null` are omitted — they aren't representable in43// the config schema.44});45});46});474849