| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
| 8 天前 | ||
| 2 个月前 | ||
| 13 天前 | ||
| 8 个月前 | ||
| 8 个月前 | ||
| 11 个月前 | ||
| 6 个月前 | ||
| 8 个月前 | ||
| 8 个月前 | ||
| 6 个月前 | ||
| 7 个月前 | ||
| 8 个月前 | ||
| 1 个月前 |
How to run bindings test?
first, you need download a SDK package, then unzip ets component into bindings/test/ directory.
Download SDK package from here.
unzip /path/to/ets-xxx.zip -d /path/to/bindings/test/
cd /path/to/bindings
### run test
npm install
npm run test
tips
- If you want to update a lot of expected results, you can use
npm run test:updateto update all expected results.
testcase directory structure
. ├── cases.ts ├── run_tests.ts ├── expected │ ├── exampleFuncName.json └── testcases ├── .idea │ └── .deveco │ ├── exampleFuncName │ │ └── arktsconfig.json │ ├── lsp_build_config.json │ └── lsp_compileFileInfos.json └── exampleFuncName └── exampleFuncName1.ets
case.ts:
{
testName: {
"expectedFilePath": "/path/to/expected.json",
"1": [ "param1", "param2" ], // lsp will call lsp.testName(param1, param2)
"2": [ "param1", "param2" ]
}
}
How to add a new test case?
- add exampleFuncName2.ets file in
testcases/exampleFuncNamedirectory - add parameters in
cases.tsfile - add expected result in
expected/exampleFuncName.jsonfile
How to add a new test function?
- add exampleFuncName2 directory in
testcasesdirectory - add exampleFuncName2 field in
cases.tsfile - add exampleFuncName2.json in
expecteddirectory - add a new test case according to the above steps