fix rendering of environment-backed variables

This commit is contained in:
2026-06-30 12:24:10 +02:00
parent b00dee4f10
commit 42b8f337af
2 changed files with 23 additions and 9 deletions
+14 -1
View File
@@ -3,7 +3,7 @@ import assert from 'node:assert/strict';
import fs from 'node:fs';
import os from 'node:os';
import path from 'node:path';
import { getRequestConfigForFile, mergeRequestConfig } from './generate-http-docs.js';
import { buildRequestContent, getRequestConfigForFile, mergeRequestConfig } from './generate-http-docs.js';
test('does not inherit parent auth when a child config has no auth override', () => {
const parentAuth = { type: 'bearer', token: 'parent-token' };
@@ -32,3 +32,16 @@ test('reads auth inherit from a Bruno-style http block', () => {
assert.deepEqual(config.auth, { type: 'bearer', token: 'parent-token' });
});
test('renders dotenv placeholders in generated variable definitions', () => {
const request = {
url: 'https://example.test',
params: [
{ name: 'username', value: '{{elixFormsApiUsername}}', type: 'path' },
],
};
const output = buildRequestContent(request, 'Logout', {}, new Set(['elixFormsApiUsername']));
assert.match(output, /@username = "\{\{\$dotenv elixFormsApiUsername\}\}"/);
});