我有一个测试脚本,内容如下:
Jest --cli
在pre-commit hook中运行它没有问题,这意味着:
- 测试将运行
- git commit 发生。
然而,在pre-push 钩子中运行同样的东西是行不通的。测试仍在运行,但实际推送并未发生!
这是钩子脚本:
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
cd client
npm run test
npm_test_exit_code=$?
exit $npm_test_exit_code
我尝试用 运行 Jest --detectOpenHandles
,找不到任何问题或打开句柄。我不确定这里的问题是什么,任何意见表示赞赏。