【问题标题】:ava watch functionality and transpiling typescriptava watch 功能和转译打字稿
【发布时间】:2016-11-13 14:38:29
【问题描述】:

当我在 typescript 中编写测试时,是否可以使用 ava --watch 功能?

现在我有这样的东西

"test": "tsc -p tsconfig.test.json && ava \"dist_test/**/*.js\""

只有在开发期间让它只测试修改过的源/测试文件会更好。

【问题讨论】:

    标签: typescript ava


    【解决方案1】:

    您可以使用chokidar-cli 来检测文件更改并让它手动运行构建和测试。

    "test": "tsc -p tsconfig.test.json && ava \"dist_test/**/*.js\"",
    "test:watch": "chokidar \"dist_test/**/*.js\" -c \"npm run test\" --initial",
    

    一旦在任何文件中检测到更改,它将为您运行test

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-04-11
      • 2022-01-24
      • 1970-01-01
      • 2020-04-25
      • 2021-06-30
      • 1970-01-01
      • 2020-10-04
      • 2017-02-03
      相关资源
      最近更新 更多