Skip to content

Instantly share code, notes, and snippets.

@jtigger
Last active June 2, 2019 02:56
Show Gist options
  • Save jtigger/24da8b7d768b889758b8d7a39d429858 to your computer and use it in GitHub Desktop.
Save jtigger/24da8b7d768b889758b8d7a39d429858 to your computer and use it in GitHub Desktop.
Running Ginkgo specs in GoLand
  1. Create a starter test

    package main
    
    import (
      . "github.com/onsi/ginkgo"
      . "github.com/onsi/gomega"
    )
    
    var _ = Describe("Tool", func() {
      It("should maintain logic", func() {
        Expect(true).To(Equal(false))
      })
    })
  2. Generate the suite runner

    $ ginkgo bootstrap

    (which yields <package-name>_suite_test.go)

  3. Create a "Go Test" Run Configuration for the suite

    1. Back in GoLand, open <package-name>_suite_test.go.
    2. In the gutter, click the green "play" button.
  4. Configure the execution to recurse to pick-up all tests:

    1. Run > Edit Configurations...
    2. Under the Go Test node, select the node named <TestName> in <package-name>_suite_test.go
    3. Set Go tool arguments to -r
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment