Repository navigation
fix(generator): log a failing generate() also without testcaseMeta - #67
Merged
Merged
Conversation
The catch block of DataGeneratorBase.generate() read generatorDirective.testcaseMeta.tableName unguarded. A directive built by hand (a test, a direct call) has no testcaseMeta, so the error handler threw itself instead of logging the error and returning undefined. The testing sample in docs/api/logger.md hit exactly that. Docs, from the lektorat of the regenerated website pages: - processor: options writeStaticData / writeMetaData; the multiple writers sample says it continues the examples above - file-processor: parameter table uses columnNumber / rowNumber - data-generator: no eslint comment in the sample - guide/overview: the processor sample says what it continues Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
🎉 This PR is included in version 3.3.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Found by the lektorat of the regenerated website API pages: the testing sample in
docs/api/logger.md(added in #66) did not run.DataGeneratorBase.generate()catches an error ofdoGenerate()to log it, but its catch block readgeneratorDirective.testcaseMeta.tableNameunguarded. A directive built by hand (a test, a direct call) has notestcaseMeta, so the handler itself threwCannot read properties of undefined (reading 'tableName')instead of logging and returningundefined. In a processor runtestcaseMetais always set, so only direct callers were affected.Fix: optional chaining in the catch block;
tableName/fieldNamefall back to'unknown'as before.Small doc fixes from the same lektorat: processor options
writeStaticData/writeMetaData, parameter names in thecellValuetable, no eslint comment in a sample, continuation notes on two fragment samples.Test plan
doGenerate()with a directive withouttestcaseMetais logged and returnsundefined; fails against the old codeAfter merge (→ 3.3.1) the website API pages are regenerated.
🤖 Generated with Claude Code