Skip to content

Commit 86c25b1

Browse files
committed
Integration Tests, Prevent duplicated mixin fields
1 parent b12b80b commit 86c25b1

16 files changed

+824
-4
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
.DS_Store
2-
node_modules
2+
node_modules
3+
test/output

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@ All notable changes to this project will be documented in this file.
44

55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
## [1.3.0] - 2025-11-09
8+
9+
### Added
10+
11+
- Added integration tests that can be invoked by `npm run test`
12+
- New Fix: Prevent duplicated mixin fields on classes with constructors. Resolves [JSDoc Issue #2092](https://github.com/jsdoc/jsdoc/issues/2092)
13+
714
## [1.2.1] - 2025-09-21
815

916
### Fixed

README.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ Modern JavaScript syntax isn’t always accurately recognized by JSDoc. This plu
1717
* Fixes various ES6 default export issues - corrects wrong names and structures for exported classes, functions, object literals, and their members.
1818
* Static class properties are correctly parsed with static scope instead of instance scope.
1919
* ES6 class mixin static members retain their static scope during augmentation.
20+
* Prevents duplicated mixin fields when classes declare constructors.
2021
* Works seamlessly with JSDoc's default parser.
2122
* Works with all themes (but see note below!).
2223
* Perfectly integrates with [VisionTheme](https://github.com/alphanull/jsdoc-vision-theme) for a modern UI (optional).
@@ -165,6 +166,16 @@ class TestClass extends TestMixin {
165166
* `TestClass.staticMethod` retains static scope during mixin augmentation (fixes JSDoc Bug #2146).
166167
* `TestClass.classStaticProp` is correctly parsed as static scope.
167168

169+
## Tests
170+
171+
Run the integration suite to ensure all plugin features keep working:
172+
173+
```bash
174+
npm test
175+
```
176+
177+
Snapshots land in the destination chosen in `test/jsdoc.config.json` (default `test/output/`) for manual inspection.
178+
168179
## Limitations
169180

170181
While there are no limitations with this plugin per se, for private members (which start with "#") there can be resulting hash links containing two hashes, like: `<a href="##privateMember">#privateMember</a>` which can lead to broken links. Unfortunately, this cannot be handled by the plugin itself and needs to be managed by the theme.
@@ -175,4 +186,4 @@ The good news is that documenting modern code typically requires a modern theme
175186

176187
[MIT License](https://opensource.org/license/MIT)
177188

178-
Copyright © 2025–present Frank Kudermann @ [alphanull.de](https://alphanull.de)
189+
Copyright © 2025–present Frank Kudermann @ [alphanull.de](https://alphanull.de)

index.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@
55
* - Bound arrow functions (#method = () => {})
66
* - Static class properties (fixes JSDoc bug #2144)
77
* - ES6 class mixin static members (fixes JSDoc bug #2146)
8+
* - Prevent duplicated mixin fields on classes with constructors. (fixes JSDoc bug #2092)
89
* It injects missing @function and @private tags where necessary and formats the resulting doclets consistently.
910
* @author Frank Kudermann @ alphanull
10-
* @version 1.2.1
11+
* @version 1.3.0
1112
* @license MIT
1213
*/
1314
const handlers = {
@@ -98,6 +99,11 @@ const handlers = {
9899
// Phase 2: Apply corrections for all relevant doclets
99100
for (const doclet of doclets) {
100101

102+
// Prevent duplicate mixin augmentation for synthetic/undocumented class doclets (#2092)
103+
if (Array.isArray(doclet.mixes) && doclet.mixes.length > 0 && doclet.undocumented) {
104+
doclet.mixes = [];
105+
}
106+
101107
// Handle value-carrying assignment doclets related to private properties
102108
if (doclet.kind === 'member'
103109
&& doclet.scope === 'inner'

0 commit comments

Comments
 (0)