Can I run a single unit test from the command line for a Grails project?

后端 未结 5 1677
借酒劲吻你
借酒劲吻你 2021-02-01 15:01

I\'ve been running my Grails unit tests by typing grails test-app :unit, which runs all unit tests. Is there a way to specify a single test?

Edit:<

5条回答
  •  梦毁少年i
    2021-02-01 15:05

    Given a test class foo.BarTests you can run just the tests in that class using the following command:

    grails test-app :unit foo.Bar
    

    Or run a single test method within that class using:

    grails test-app :unit foo.Bar.testMethod
    

    Note that you do not include the word "Tests" when specifying the name of test class.

提交回复
热议问题