fix rendering of environment-backed variables
This commit is contained in:
@@ -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\}\}"/);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user