[extensions] Add an initial set of extension variables (#7035)

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
This commit is contained in:
christine betts 2025-08-26 02:13:16 +00:00 committed by GitHub
parent 75b1e01bb0
commit b6cca01161
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 166 additions and 5 deletions

View file

@ -0,0 +1,18 @@
/**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import { expect, describe, it } from 'vitest';
import { hydrateString } from './variables.js';
describe('hydrateString', () => {
it('should replace a single variable', () => {
const context = {
extensionPath: 'path/my-extension',
};
const result = hydrateString('Hello, ${extensionPath}!', context);
expect(result).toBe('Hello, path/my-extension!');
});
});