我正在尝试使用Typescript在现有的Zend Framework2项目上创建CasperJS前端测试。
ZF2项目结构设置如下:
project
- .composer
- config
- data
- module
-- Application
-- Module1
--- config (module1 config)
--- src (php sources)
--- view (module1 view files)
--- test
---- Module1Test (has PHPUnit tests)
---- UI
----- Tests
------ SubArea
------ testArea.casper.ts
-- Module2
...
- public
- vendor
- tests
-- backend
-- frontend
--- casperjs
...
---- tsconfig.json我正在尝试让我的tsconfig.json找到并编译每个应用程序模块测试目录中的所有测试文件,并将其放到根目录/ *.casper.ts /前端中的一个临时目录中。大约有30个模块。
目前,我的文件如下所示:
{
"compilerOptions": {
"module": "commonjs",
"target": "es5",
"sourceMap": true,
"moduleResolution": "node",
"experimentalDecorators": true,
"outDir": "./_tmp/build/"
},
"filesGlob": [
"../../../module/**/test/UI/Tests/Demo/*.casper.ts",
"!./node_modules/**/*.ts"
],
"exclude": [
"node_modules"
]
}但是它找不到任何文件。
如何创建在tsconfig.json文件本身之上的目录中查找文件的filesGlob规则?就像这样:
"../../../module/**/test/UI/Tests/Demo/*.casper.ts"谢谢
发布于 2020-07-20 19:54:06
从TypeScript2.0开始,随着include在tsconfig.json中的引入,tsconfig.json是deprecated。
include中指定的路径支持glob模式。
此外,请使用带有双星号的casper.ts文件的更宽路径,如下所示:
{
"compilerOptions": {
...
},
"include": ["./**/casper.ts"]
}https://stackoverflow.com/questions/42715025
复制相似问题