Testing 咕噜+;功能测试

Testing 咕噜+;功能测试,testing,gruntjs,automated-tests,Testing,Gruntjs,Automated Tests,我已经设置了grunt任务,以便在本地机器上使用CasperJS进行一些功能测试。一切正常 我想知道是否有办法一直运行测试直到失败?或者运行一定次数的测试 在powershell中,您可以“cd”到目录并使用以下一行程序: do { grunt } while (1 -eq 1} 下面是Bash中的等效项: while [ 1 -eq 1 ]; do grunt done 这应该在无限循环中反复运行grunt,您可以使用ctrl+c停止。如果您希望它在失败后立即停止,则需要一个脚本(我提供B

我已经设置了grunt任务,以便在本地机器上使用CasperJS进行一些功能测试。一切正常

我想知道是否有办法一直运行测试直到失败?或者运行一定次数的测试

在powershell中,您可以“cd”到目录并使用以下一行程序:

do { grunt } while (1 -eq 1}
下面是Bash中的等效项:

while [ 1 -eq 1 ]; do grunt done
这应该在无限循环中反复运行grunt,您可以使用
ctrl+c
停止。如果您希望它在失败后立即停止,则需要一个脚本(我提供Bash,因为我对powershell不太熟悉):

#! /bin/sh
result=0
while [ $result -eq 0 ]; do
  grunt || result=1  
done