22// SPDX-License-Identifier: Apache-2.0
33import path from "node:path" ;
44
5- import { documentTestUtils , writeComponentsDocumentation } from "@cloudscape-design/documenter" ;
6-
7- import { writeSourceFile } from "./utils.js" ;
5+ import { writeComponentsDocumentation , writeTestUtilsDocumentation } from "@cloudscape-design/documenter" ;
86
97const targetDir = "lib/components/internal/api-docs" ;
108
@@ -20,16 +18,16 @@ function componentDocs() {
2018}
2119
2220function testUtilDocs ( ) {
23- const tsconfig = path . resolve ( "src/test-utils/tsconfig.json" ) ;
24- [ "dom" , "selectors" ] . forEach ( ( testUtilType ) => {
25- const componentWrapperDefinitions = documentTestUtils ( { tsconfig } , `**/{ ${ testUtilType } ,types}/**/*` ) ;
26-
27- const indexContent = `module.exports = {
28- classes: ${ JSON . stringify ( componentWrapperDefinitions ) }
29- }
30- ` ;
31-
32- const outPath = path . join ( targetDir , "test-utils-doc" , ` ${ testUtilType } .js` ) ;
33- writeSourceFile ( outPath , indexContent ) ;
21+ writeTestUtilsDocumentation ( {
22+ outDir : path . join ( targetDir , "test-utils-doc" ) ,
23+ tsconfigPath : path . resolve ( "src/test-utils/tsconfig.json" ) ,
24+ domUtils : {
25+ root : "src/test-utils/dom/index.ts" ,
26+ extraExports : [ "default" , "ElementWrapper" ] ,
27+ } ,
28+ selectorsUtils : {
29+ root : "src/test-utils/selectors/index.ts" ,
30+ extraExports : [ "default" , "ElementWrapper" ] ,
31+ } ,
3432 } ) ;
3533}
0 commit comments