更新时间:2023-12-05 12:07:52
在 grails test-app 中添加 -echoOut 开关,这是 1.2 版本中的新内容:
Add the -echoOut switch to grails test-app, this is new in the 1.2 release:
grails test-app -echoOut
test-app 上还有许多其他有用的开关,包括:
There are a number of other useful switches on test-app as well, including:
回显 System.err 消息:
echo System.err messages:
grails test-app -echoErr
在运行测试之前强制清理(不执行 grails clean && grails test-app):
force a clean before running tests (without doing grails clean && grails test-app):
grails test-app -clean
只运行单元测试:
grails test-app unit:
只运行集成测试:
grails test-app integration:
在特定环境中运行:
grails -Dgrails.env=production test-app
仅针对特定的测试类(如 com.foo.MyControllerTests)运行测试,一定要去掉测试"后缀:
run tests only for a particular test class (like com.foo.MyControllerTests), be sure to leave off the "Tests" suffix:
grails test-app com.foo.MyController
只重新运行上次运行测试失败的测试
rerun only the tests that failed the last time you ran your tests
grails test-app -rerun