如何从 tsdoc / typedoc 中正确排除测试文件

问题描述

我正在测试一些各种文档引擎,我想为我们的大型项目尝试使用 typedoc。我们在整个项目中有各种测试文件(somefile.test.tssomeotherfile.test.tsx)。我正在努力让 typedoc 忽略这些文件。我做了 npm i -D typedoc,然后在我的 tsconfig.json

{
  "compilerOptions": {
    "configOptions": "some_options"
  },"include": ["src"],"typedocOptions": {
    "out": "docs","entryPoints": "src/index.tsx","exclude": [
      "**/*.test.ts*","**/*.test.tsx*"
    ]
  }
}

然后我运行我的 npm 命令 "tsdoc": "typedoc" - npm run tsdoc。 Typedoc 遍历我的文件并在我的测试文件中发现了大量的打字稿检查错误,因此它无法运行。 (我们最近更新了 @types/jest,所以 eslint 和 ts 抱怨 Property 'toEqual' does not exist on type 'Assertion'Property 'toMatchSnapshot' does not exist on type 'Assertion' 之类的东西。eslint 和 ts 抱怨这些东西,但它不会阻止测试运行. 但是我的 typedocOptions 没有正确忽略这些文件有什么问题?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)