test: added tests for isGenerationConditionMet and conditionalParameterGeneration#1977
test: added tests for isGenerationConditionMet and conditionalParameterGeneration#1977shivansh-source wants to merge 1 commit intoasyncapi:masterfrom
Conversation
Signed-off-by: shivansh-source <shivanshsiddhi1234@gmail.com>
|
What reviewer looks at during PR reviewThe following are ideal points maintainers look for during review. Reviewing these points yourself beforehand can help streamline the review process and reduce time to merge.
|
📝 WalkthroughWalkthroughThe implementation modifies conditional generation logic by adding early branching for subject and parameter condition types, fixing argument passing to conditionalSubjectGeneration, improving null-safe checks, and replacing deprecated paths. A comprehensive test suite is added to verify multiple evaluation branches, server context injection, parameter validation, edge cases, and integration scenarios. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~30 minutes 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Tip Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Welcome to AsyncAPI. Thanks a lot for creating your first pull request. Please check out our contributors guide useful for opening a pull request.
Keep in mind there are also other channels you can use to interact with AsyncAPI community. For more details check out this issue.
|
There was a problem hiding this comment.
Actionable comments posted: 6
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (3)
apps/generator/lib/conditionalGeneration.js (3)
71-80:⚠️ Potential issue | 🔴 Critical
conditionalParameterGenerationnever invokes thevalidatefunction.The function checks only whether the parameter value is
null/undefinedand returnstruefor any other value. Thevalidatecallback from the config is completely ignored, so parameter-based validations (e.g., enum checks, boolean flags) always pass.This will cause tests like "should return false when parameter value fails validation" and "should support enum-style parameter validation" to fail.
🐛 Proposed fix: delegate to `validateStatus` after the null guard
async function conditionalParameterGeneration(templateConfig, matchedConditionPath, templateParams) { const conditionalGenerationConfig = templateConfig.conditionalGeneration?.[matchedConditionPath]; const parameterName = conditionalGenerationConfig.parameter; const parameterValue = templateParams[parameterName]; if (parameterValue == null) { log.debug(logMessage.relativeSourceFileNotGenerated(matchedConditionPath, parameterName)); return false; } - return true; + return validateStatus(parameterValue, matchedConditionPath, templateConfig); }
29-57:⚠️ Potential issue | 🟠 MajorEarly branching makes lines 35-57 unreachable dead code.
The new
if (config.subject) / else if (config.parameter)at lines 29-33 returns before the existing logic at lines 35-57 is ever reached:
- If
config.subjectis truthy → early return at line 30.- If
config.parameteris truthy → early return at line 32.- If neither →
subjectat line 35 is guaranteed falsy, so line 39's&& subjectis always false, and line 48'sif (subject)is always false.Notably,
conditionalFilesGenerationDeprecatedVersionat line 40 is called but never defined in this file — it would throw aReferenceErrorif reached. The early branching masks this but the dead code is confusing and fragile.Additionally, the early branch uses
config(which may come fromconditionFilesGeneration), butconditionalSubjectGenerationinternally resolves its own config fromconditionalGenerationfirst (line 108). This mismatch means the trigger condition (config.subjectfrom deprecated config) may differ from the config actually used inside the function.Either remove lines 35-57 entirely (since the early branch handles all cases), or restructure so there's a single, clear decision path.
♻️ Proposed simplification: remove dead code
const config = Object.keys(conditionFilesGeneration).length > 0 ? conditionFilesGeneration : conditionalGeneration; - if (config.subject) { - return conditionalSubjectGeneration(asyncapiDocument, templateConfig, matchedConditionPath, templateParams); - } else if (config.parameter) { - return conditionalParameterGeneration(templateConfig, matchedConditionPath, templateParams); - } - - const subject = config?.subject; - - // conditionalFiles becomes deprecated with this PR, and soon will be removed. - // TODO: https://github.com/asyncapi/generator/issues/1553 - if (Object.keys(conditionFilesGeneration).length > 0 && subject) { - return conditionalFilesGenerationDeprecatedVersion( - asyncapiDocument, - templateConfig, - matchedConditionPath, - templateParams - ); - } else if (Object.keys(conditionalGeneration).length > 0) { - // Case when the subject is present in conditionalGeneration - if (subject) { - return conditionalSubjectGeneration( - asyncapiDocument, - templateConfig, - matchedConditionPath, - templateParams // FIX: was missing in original, caused TypeError on templateParams.server - ); - } - return conditionalParameterGeneration(templateConfig, matchedConditionPath, templateParams); - } + if (config.subject) { + return conditionalSubjectGeneration(asyncapiDocument, templateConfig, matchedConditionPath, templateParams); + } else if (config.parameter) { + return conditionalParameterGeneration(templateConfig, matchedConditionPath, templateParams); + }
82-101:⚠️ Potential issue | 🟡 MinorDuplicate JSDoc block for
conditionalSubjectGeneration.Lines 82-91 and 92-101 contain the same doc comment. Remove one.
Proposed fix
-/** - * Determines whether a file should be conditionally included based on the provided subject expression - * and optional validation logic defined in the template configuration. - * `@private` - * `@param` {Object} asyncapiDocument - The parsed AsyncAPI document instance used for context evaluation. - * `@param` {Object} templateConfig - The configuration object that contains `conditionalFiles` rules. - * `@param` {string} matchedConditionPath - The path of the file/folder being conditionally generated. - * `@param` {Object} templateParams - The parameters passed to the generator, usually user input or default values. - * `@returns` {Boolean} - Returns `true` if the file should be included; `false` if it should be skipped. - */ /** * Determines whether a file should be conditionally included based on the provided subject expression * and optional validation logic defined in the template configuration.
🤖 Fix all issues with AI agents
In `@apps/generator/lib/conditionalGeneration.js`:
- Around line 29-33: The if/else-if branch uses inconsistent indentation and an
extra space after templateConfig; update the block around the config check so
indentation matches the project's 2-space style and remove the double space in
the call to conditionalParameterGeneration(templateConfig, matchedConditionPath,
templateParams); ensure the calls to
conditionalSubjectGeneration(asyncapiDocument, templateConfig,
matchedConditionPath, templateParams) and conditionalParameterGeneration(...)
are indented consistently with surrounding code and use single spaces after
commas.
In `@apps/generator/test/conditionalGeneration.test.js`:
- Around line 435-456: The test descriptions in the
conditionalGeneration.test.js are incorrect and don't match their assertions;
update the test case titles (the it(...) strings) so they accurately reflect the
asserted behavior for isGenerationConditionMet (e.g., change "should return true
when subject is found and no validation function exists" to "should return false
when subject is found and no validation function exists" and change "should
return true when condition is not specified" to "should return undefined when
condition is not specified"), keeping the existing assertions and mocking
(jmespath.search, mockTemplateParams, mockAsyncAPIDocument) unchanged so the
test names match the behavior being tested.
- Around line 159-194: The tests fail because the conditionalParameterGeneration
logic (used by isGenerationConditionMet / conditionalGeneration) only checks
parameter presence (null/undefined) and never calls the provided validate
function; update the implementation in the conditionalParameterGeneration path
to invoke the configured validator (either call the validate function on the
rule object or call validateStatus if that helper exists) with the parameter
value and use its boolean result as the condition. Ensure you reference the rule
under conditionalGeneration[filePath].parameter and
conditionalGeneration[filePath].validate (or the validateStatus helper) so that
cases like { includeDocs: false } and { protocol: 'http' } return false when
validate rejects them, and keep existing logging (log.debug with
logMessage.conditionalGenerationMatched(filePath)) consistent when a match
occurs.
- Around line 406-433: The test declares mockGet with const inside beforeEach so
it isn't available to the it blocks; move the declaration of mockGet to the
outer describe scope (declare let mockGet; above beforeEach) and then assign
mockGet = jest.fn(...) inside beforeEach, ensuring all assertions (e.g.,
expect(mockGet).toHaveBeenCalledWith(...)) and the
mockAsyncAPIDocument.servers.get reference use that hoisted variable; keep
beforeEach assigning mockAsyncAPIDocument.servers.get to mockGet and leave the
rest of the setup intact.
- Around line 364-387: The test's expectations conflict with
isGenerationConditionMet's current flow: when both conditionalFiles and
conditionalGeneration exist the function selects conditionFilesGeneration (the
combined config) but only uses the deprecated validate path if config.subject is
defined, so deprecatedValidate and log.conditionalFilesMatched are never invoked
for the provided mixed config. Fix by either updating the test to reflect
current behavior (assert deprecatedValidate is NOT called and assert the
conditionalParameterGeneration branch behavior) or change
isGenerationConditionMet to prefer the conditionalFiles.validate path when
conditionalFiles contains an entry for filePath (i.e. in
isGenerationConditionMet ensure that when
templateConfig.conditionalFiles[filePath] exists you call its validate with the
resolved subject/value and emit log.conditionalFilesMatched(filePath));
reference isGenerationConditionMet, templateConfig.conditionalFiles,
templateConfig.conditionalGeneration, deprecatedValidate, and
log.conditionalFilesMatched when making the change.
- Around line 389-402: Add a missing closing "});" to terminate the
describe('isGenerationConditionMet()') block before the "PART 2" section so that
describe('conditionalSubjectGeneration()'), describe('validateStatus()'),
describe('conditionalFilesGenerationDeprecatedVersion()' ) and the Integration
tests are not nested inside isGenerationConditionMet(); specifically insert the
closing for describe('isGenerationConditionMet()') immediately before the
comment block that begins "PART 2: Tests for conditionalSubjectGeneration,
validateStatus, and deprecated functions". After adding that closing, remove the
extra redundant "});" near the end of the file (around the previously noted
closing at ~line 1050) to keep brace counts balanced.
🧹 Nitpick comments (1)
apps/generator/test/conditionalGeneration.test.js (1)
431-432: Preferjest.mock('jmespath', ...)over monkey-patching the module export.Directly assigning
jmespath.search = jest.fn()inbeforeEachreplaces the real implementation for all subsequent tests in the file. The earlier tests (lines 48–151) rely on realjmespathbehavior and would break if test execution order ever changed (e.g.,--randomize). Usingjest.mockwithjest.requireActualgives you controlled mocking with proper isolation viajest.restoreAllMocks().
| if (config.subject) { | ||
| return conditionalSubjectGeneration(asyncapiDocument, templateConfig, matchedConditionPath, templateParams); | ||
| } else if (config.parameter) { | ||
| return conditionalParameterGeneration(templateConfig, matchedConditionPath, templateParams); | ||
| } |
There was a problem hiding this comment.
Inconsistent indentation in the early-branch block.
The if/else if block mixes 4-space and 2-space indentation and has a double space after templateConfig, on line 32. If the dead code below is removed (see other comment), this block should use consistent project indentation.
Proposed fix (assuming 2-space project indent)
- if (config.subject) {
- return conditionalSubjectGeneration(asyncapiDocument, templateConfig, matchedConditionPath, templateParams);
- } else if (config.parameter) {
- return conditionalParameterGeneration(templateConfig, matchedConditionPath, templateParams);
- }
+ if (config.subject) {
+ return conditionalSubjectGeneration(asyncapiDocument, templateConfig, matchedConditionPath, templateParams);
+ } else if (config.parameter) {
+ return conditionalParameterGeneration(templateConfig, matchedConditionPath, templateParams);
+ }📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| if (config.subject) { | |
| return conditionalSubjectGeneration(asyncapiDocument, templateConfig, matchedConditionPath, templateParams); | |
| } else if (config.parameter) { | |
| return conditionalParameterGeneration(templateConfig, matchedConditionPath, templateParams); | |
| } | |
| if (config.subject) { | |
| return conditionalSubjectGeneration(asyncapiDocument, templateConfig, matchedConditionPath, templateParams); | |
| } else if (config.parameter) { | |
| return conditionalParameterGeneration(templateConfig, matchedConditionPath, templateParams); | |
| } |
🤖 Prompt for AI Agents
In `@apps/generator/lib/conditionalGeneration.js` around lines 29 - 33, The
if/else-if branch uses inconsistent indentation and an extra space after
templateConfig; update the block around the config check so indentation matches
the project's 2-space style and remove the double space in the call to
conditionalParameterGeneration(templateConfig, matchedConditionPath,
templateParams); ensure the calls to
conditionalSubjectGeneration(asyncapiDocument, templateConfig,
matchedConditionPath, templateParams) and conditionalParameterGeneration(...)
are indented consistently with surrounding code and use single spaces after
commas.
| it('should return true when parameter value passes validation', async () => { | ||
| const filePath = 'src/docs/'; | ||
| const templateConfig = { | ||
| conditionalGeneration: { | ||
| [filePath]: { | ||
| parameter: 'includeDocs', | ||
| validate: (val) => val === true, | ||
| }, | ||
| }, | ||
| }; | ||
|
|
||
| const result = await isGenerationConditionMet( | ||
| templateConfig, filePath, { includeDocs: true }, null | ||
| ); | ||
| expect(result).toBe(true); | ||
| }); | ||
|
|
||
| it('should return false when parameter value fails validation', async () => { | ||
| const filePath = 'src/docs/'; | ||
| const templateConfig = { | ||
| conditionalGeneration: { | ||
| [filePath]: { | ||
| parameter: 'includeDocs', | ||
| validate: (val) => val === true, | ||
| }, | ||
| }, | ||
| }; | ||
|
|
||
| const result = await isGenerationConditionMet( | ||
| templateConfig, filePath, { includeDocs: false }, null | ||
| ); | ||
| expect(result).toBe(false); | ||
| expect(log.debug).toHaveBeenCalledWith( | ||
| logMessage.conditionalGenerationMatched(filePath) | ||
| ); | ||
| }); |
There was a problem hiding this comment.
Multiple parameter-validation tests will fail due to the implementation bug.
Since conditionalParameterGeneration only checks for null/undefined and never invokes validate (see review comment on the implementation file):
- Line 190:
{ includeDocs: false }→false != null→ returnstrue, but test expectsfalse. - Line 229:
{ protocol: 'http' }→'http' != null→ returnstrue, but test expectsfalse.
These tests correctly describe the expected behavior. Once the implementation is fixed to call validateStatus (or invoke validate directly), they should pass.
Also applies to: 213-231
🤖 Prompt for AI Agents
In `@apps/generator/test/conditionalGeneration.test.js` around lines 159 - 194,
The tests fail because the conditionalParameterGeneration logic (used by
isGenerationConditionMet / conditionalGeneration) only checks parameter presence
(null/undefined) and never calls the provided validate function; update the
implementation in the conditionalParameterGeneration path to invoke the
configured validator (either call the validate function on the rule object or
call validateStatus if that helper exists) with the parameter value and use its
boolean result as the condition. Ensure you reference the rule under
conditionalGeneration[filePath].parameter and
conditionalGeneration[filePath].validate (or the validateStatus helper) so that
cases like { includeDocs: false } and { protocol: 'http' } return false when
validate rejects them, and keep existing logging (log.debug with
logMessage.conditionalGenerationMatched(filePath)) consistent when a match
occurs.
| it('should use conditionalFiles path when both conditionalFiles and conditionalGeneration are present', async () => { | ||
| const filePath = 'src/both.js'; | ||
| const asyncapiDoc = makeMockDocument({ info: { version: '2.0.0' } }); | ||
|
|
||
| const deprecatedValidate = jest.fn((val) => val === '1.0.0'); // returns false for '2.0.0' | ||
|
|
||
| const templateConfig = { | ||
| conditionalFiles: { | ||
| [filePath]: { validate: deprecatedValidate }, | ||
| }, | ||
| conditionalGeneration: { | ||
| [filePath]: { subject: 'info.version' }, | ||
| }, | ||
| }; | ||
|
|
||
| const result = await isGenerationConditionMet( | ||
| templateConfig, filePath, {}, asyncapiDoc | ||
| ); | ||
| expect(result).toBe(false); | ||
| expect(deprecatedValidate).toHaveBeenCalledWith('2.0.0'); | ||
| expect(log.debug).toHaveBeenCalledWith( | ||
| logMessage.conditionalFilesMatched(filePath) | ||
| ); | ||
| }); |
There was a problem hiding this comment.
Test expectations may not match the actual code flow.
Given the config:
conditionalFiles: { [filePath]: { validate: deprecatedValidate } } // no subject
conditionalGeneration: { [filePath]: { subject: 'info.version' } } // no validateAt line 26-28, config = conditionFilesGeneration (because it has keys). Since config.subject is undefined (the deprecated entry has no subject), the early branch at line 29 doesn't fire. The fallthrough eventually reaches conditionalParameterGeneration (not the deprecated path), which never invokes deprecatedValidate.
The assertions at line 383 (expect(deprecatedValidate).toHaveBeenCalledWith('2.0.0')) and line 384-386 (the conditionalFilesMatched log) won't hold. The comment block at lines 390-395 also describes a flow that doesn't match the implementation.
Please re-examine the intended behavior for this mixed-config scenario and update either the implementation or the test accordingly.
🤖 Prompt for AI Agents
In `@apps/generator/test/conditionalGeneration.test.js` around lines 364 - 387,
The test's expectations conflict with isGenerationConditionMet's current flow:
when both conditionalFiles and conditionalGeneration exist the function selects
conditionFilesGeneration (the combined config) but only uses the deprecated
validate path if config.subject is defined, so deprecatedValidate and
log.conditionalFilesMatched are never invoked for the provided mixed config. Fix
by either updating the test to reflect current behavior (assert
deprecatedValidate is NOT called and assert the conditionalParameterGeneration
branch behavior) or change isGenerationConditionMet to prefer the
conditionalFiles.validate path when conditionalFiles contains an entry for
filePath (i.e. in isGenerationConditionMet ensure that when
templateConfig.conditionalFiles[filePath] exists you call its validate with the
resolved subject/value and emit log.conditionalFilesMatched(filePath));
reference isGenerationConditionMet, templateConfig.conditionalFiles,
templateConfig.conditionalGeneration, deprecatedValidate, and
log.conditionalFilesMatched when making the change.
| }); | ||
| /** | ||
| * Key insight: With the preference for conditionalGeneration, config uses new (with subject). | ||
| * validateStatus() falls back to conditionalFiles.validate since new has no validate. | ||
| * Subject resolves to '2.0.0' → deprecatedValidate('2.0.0') → false. | ||
| * Log uses conditionalGenerationMatched since new config exists. | ||
| */ | ||
|
|
||
| // ============================================================================ | ||
| // PART 2: Tests for conditionalSubjectGeneration, validateStatus, | ||
| // and deprecated functions | ||
| // ============================================================================ | ||
|
|
||
| describe('conditionalSubjectGeneration()', () => { |
There was a problem hiding this comment.
Missing }); to close describe('isGenerationConditionMet()') before PART 2.
Line 389 closes describe('edge cases'), but there's no corresponding }); to close describe('isGenerationConditionMet()') before the PART 2 describes begin at line 402. As a result, conditionalSubjectGeneration(), validateStatus(), conditionalFilesGenerationDeprecatedVersion(), and Integration tests are all nested inside isGenerationConditionMet(), producing misleading test output hierarchy.
🐛 Proposed fix: close the describe block
});
+ });
/**
- * Key insight: With the preference for conditionalGeneration, config uses new (with subject).
+ /**
+ * Key insight: With the preference for conditionalGeneration, config uses new (with subject).You'll also need to remove one of the closing }); at the end of the file (around line 1050) to keep brace counts balanced.
🤖 Prompt for AI Agents
In `@apps/generator/test/conditionalGeneration.test.js` around lines 389 - 402,
Add a missing closing "});" to terminate the
describe('isGenerationConditionMet()') block before the "PART 2" section so that
describe('conditionalSubjectGeneration()'), describe('validateStatus()'),
describe('conditionalFilesGenerationDeprecatedVersion()' ) and the Integration
tests are not nested inside isGenerationConditionMet(); specifically insert the
closing for describe('isGenerationConditionMet()') immediately before the
comment block that begins "PART 2: Tests for conditionalSubjectGeneration,
validateStatus, and deprecated functions". After adding that closing, remove the
extra redundant "});" near the end of the file (around the previously noted
closing at ~line 1050) to keep brace counts balanced.
| beforeEach(() => { | ||
| jest.clearAllMocks(); | ||
| const mockGet = jest.fn((serverName) => ({ | ||
| json: () => ({ url: 'mqtt://test.mosquitto.org', protocol: 'mqtt' }) | ||
| })); | ||
|
|
||
| mockAsyncAPIDocument = { | ||
| json: jest.fn(() => ({ | ||
| asyncapi: '2.0.0', | ||
| info: { title: 'Test API', version: '1.0.0' }, | ||
| channels: { | ||
| 'user/signup': {}, | ||
| 'user/login': {} | ||
| } | ||
| })), | ||
| servers: jest.fn(() => ({ | ||
| get: mockGet | ||
| })) | ||
| }; | ||
|
|
||
| mockTemplateParams = { | ||
| server: 'production', | ||
| customParam: 'testValue' | ||
| }; | ||
|
|
||
| jmespath.search = jest.fn(); | ||
| log.debug = jest.fn(); | ||
| }); |
There was a problem hiding this comment.
mockGet is not accessible in the it blocks — test will throw ReferenceError.
mockGet is declared with const inside the beforeEach callback at line 408, so it's scoped to that callback. The assertion at line 547 (expect(mockGet).toHaveBeenCalledWith(...)) references a variable that doesn't exist in the it block's scope.
🐛 Proposed fix: hoist `mockGet` to `describe` scope
describe('conditionalSubjectGeneration()', () => {
let mockAsyncAPIDocument;
let mockTemplateParams;
+ let mockGet;
beforeEach(() => {
jest.clearAllMocks();
- const mockGet = jest.fn((serverName) => ({
+ mockGet = jest.fn((serverName) => ({
json: () => ({ url: 'mqtt://test.mosquitto.org', protocol: 'mqtt' })
}));Also applies to: 527-556
🤖 Prompt for AI Agents
In `@apps/generator/test/conditionalGeneration.test.js` around lines 406 - 433,
The test declares mockGet with const inside beforeEach so it isn't available to
the it blocks; move the declaration of mockGet to the outer describe scope
(declare let mockGet; above beforeEach) and then assign mockGet = jest.fn(...)
inside beforeEach, ensuring all assertions (e.g.,
expect(mockGet).toHaveBeenCalledWith(...)) and the
mockAsyncAPIDocument.servers.get reference use that hoisted variable; keep
beforeEach assigning mockAsyncAPIDocument.servers.get to mockGet and leave the
rest of the setup intact.
| it('should return true when subject is found and no validation function exists', async () => { | ||
| const templateConfig = { | ||
| conditionalGeneration: { | ||
| 'path/to/file': { | ||
| subject: 'channels' | ||
| } | ||
| } | ||
| }; | ||
|
|
||
| jmespath.search.mockReturnValue({ 'user/signup': {} }); | ||
|
|
||
| const result = await isGenerationConditionMet( | ||
| templateConfig, | ||
| 'path/to/file', | ||
| mockTemplateParams, | ||
| mockAsyncAPIDocument | ||
| ); | ||
|
|
||
| // When there's no validate function, validateStatus returns false | ||
| expect(result).toBe(false); | ||
| expect(jmespath.search).toHaveBeenCalled(); | ||
| }); |
There was a problem hiding this comment.
Test names contradict their assertions.
- Line 435: "should return true when subject is found and no validation function exists" — but asserts
false(line 454). - Line 458: "should return true when condition is not specified" — but asserts
undefined(line 472).
Misleading names make future debugging harder.
Proposed fix
- it('should return true when subject is found and no validation function exists', async () => {
+ it('should return false when subject is found but no validation function exists', async () => {- it('should return true when condition is not specified', async () => {
+ it('should return undefined when condition is not specified', async () => {Also applies to: 458-473
🤖 Prompt for AI Agents
In `@apps/generator/test/conditionalGeneration.test.js` around lines 435 - 456,
The test descriptions in the conditionalGeneration.test.js are incorrect and
don't match their assertions; update the test case titles (the it(...) strings)
so they accurately reflect the asserted behavior for isGenerationConditionMet
(e.g., change "should return true when subject is found and no validation
function exists" to "should return false when subject is found and no validation
function exists" and change "should return true when condition is not specified"
to "should return undefined when condition is not specified"), keeping the
existing assertions and mocking (jmespath.search, mockTemplateParams,
mockAsyncAPIDocument) unchanged so the test names match the behavior being
tested.
|
Thanks for the contribution. I’m closing this PR because, while there is an existing issue, it was not approved or opened for contribution before the pull request was submitted. Please make sure to follow the contribution guidelines, which explain when issues are considered ready for implementation and when pull requests are appropriate |
|
i messaged u on slack can u check @Adi-204 |



document update and test are wip !
Description
Related issue(s)
#1970
Summary by CodeRabbit
Release Notes
Bug Fixes
Tests