Merge pull request #16082 from backstage/rugvip/internal

STYLE.md: document method for testing with private constructors
This commit is contained in:
Ben Lambert
2023-01-31 14:19:00 +01:00
committed by GitHub
+7
View File
@@ -94,6 +94,13 @@ This section describes guidelines for designing public APIs. It can also be appl
/* ... */
}
// In order to make a private constructor available for testing you can use a
// static factory marked as `@internal`, which will not show up in the public API.
/** @internal */
static forTesting(internalOptions?: { ... }) {
return new DefaultImageLoader(internalOptions);
}
private constructor(/* ... */) {
/* ... */
}