且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何将Ava测试分成多个文件?

更新时间:2023-02-27 08:56:44

AVA也可以处理多个文件.虽然tests/不在默认搜索模式中(test/是).假设您正在通过package.json文件配置AVA,则可以执行以下操作:

AVA works with multiple files, too. tests/ isn't in the default search pattern though (test/ is). Assuming you're configuring AVA through the package.json file you can do:

{
  "ava": {
    "files": "./tests/*.js"
  }
}