Skip to content
Back to search

ginkgo

MarketplaceWorks with Claude CodeGitHub

A Modern Testing Framework for Go

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today
Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/onsi--ginkgo/badge.svg)](/listings/onsi--ginkgo)

HTML

<a href="/listings/onsi--ginkgo"><img src="/api/listings/onsi--ginkgo/badge.svg" alt="findsafeskills safety rating" /></a>

Install

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

.claude-plugin/marketplace.json · Manifest · 18 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. {
  2. "name": "ginkgo",
  3. "owner": {
  4. "name": "Onsi Fakhouri",
  5. "url": "https://github.com/onsi"
  6. },
  7. "metadata": {
  8. "description": "Skills for writing, running, and debugging Go tests with Ginkgo — the expressive BDD testing framework, paired with Gomega.",
  9. "homepage": "https://onsi.github.io/ginkgo/"
  10. },
  11. "plugins": [
  12. {
  13. "name": "ginkgo",
  14. "source": "./plugins/ginkgo",
  15. "description": "Write, run, and debug Ginkgo/Gomega test suites in Go: the tree-construction mental model, the full node and decorator surface, tables and generated specs, parallelism, filtering, timeouts and async, CI configuration, and JSON-first failure diagnosis."
  16. }
  17. ]
  18. }
README.md · README · 144 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. <picture>
  2. <source media="(prefers-color-scheme: dark)" srcset="docs/images/ginkgo-dark.png">
  3. <img alt="Ginkgo" src="docs/images/ginkgo.png">
  4. </picture>
  5. [![test](https://github.com/onsi/ginkgo/actions/workflows/test.yml/badge.svg?branch=master)](https://github.com/onsi/ginkgo/actions/workflows/test.yml?query=branch%3Amaster) [![Ginkgo Docs](docs/images/docs-badge.svg)](https://onsi.github.io/ginkgo/) [![Sponsor onsi](docs/images/sponsor-badge.svg)](https://github.com/sponsors/onsi)
  6. ---
  7. # Ginkgo
  8. Ginkgo is a mature testing framework for Go designed to help you write expressive specs. Ginkgo builds on top of Go's `testing` foundation and is complemented by the [Gomega](https://github.com/onsi/gomega) matcher library. Together, Ginkgo and Gomega let you express the intent behind your specs clearly:
  9. ```go
  10. import (
  11. . "github.com/onsi/ginkgo/v2"
  12. . "github.com/onsi/gomega"
  13. ...
  14. )
  15. var _ = Describe("Checking books out of the library", Label("library"), func() {
  16. var library *libraries.Library
  17. var book *books.Book
  18. var valjean *users.User
  19. BeforeEach(func() {
  20. library = libraries.NewClient()
  21. book = &books.Book{
  22. Title: "Les Miserables",
  23. Author: "Victor Hugo",
  24. }
  25. valjean = users.NewUser("Jean Valjean")
  26. })
  27. When("the library has the book in question", func() {
  28. BeforeEach(func(ctx SpecContext) {
  29. Expect(library.Store(ctx, book)).To(Succeed())
  30. })
  31. Context("and the book is available", func() {
  32. It("lends it to the reader", func(ctx SpecContext) {
  33. Expect(valjean.Checkout(ctx, library, "Les Miserables")).To(Succeed())
  34. Expect(valjean.Books()).To(ContainElement(book))
  35. Expect(library.UserWithBook(ctx, book)).To(Equal(valjean))
  36. }, SpecTimeout(time.Second * 5))
  37. })
  38. Context("but the book has already been checked out", func() {
  39. var javert *users.User
  40. BeforeEach(func(ctx SpecContext) {
  41. javert = users.NewUser("Javert")
  42. Expect(javert.Checkout(ctx, library, "Les Miserables")).To(Succeed())
  43. })
  44. It("tells the user", func(ctx SpecContext) {
  45. err := valjean.Checkout(ctx, library, "Les Miserables")
  46. Expect(err).To(MatchError("Les Miserables is currently checked out"))
  47. }, SpecTimeout(time.Second * 5))
  48. It("lets the user place a hold and get notified later", func(ctx SpecContext) {
  49. Expect(valjean.Hold(ctx, library, "Les Miserables")).To(Succeed())
  50. Expect(valjean.Holds(ctx)).To(ContainElement(book))
  51. By("when Javert returns the book")
  52. Expect(javert.Return(ctx, library, book)).To(Succeed())
  53. By("it eventually informs Valjean")
  54. notification := "Les Miserables is ready for pick up"
  55. Eventually(ctx, valjean.Notifications).Should(ContainElement(notification))
  56. Expect(valjean.Checkout(ctx, library, "Les Miserables")).To(Succeed())
  57. Expect(valjean.Books(ctx)).To(ContainElement(book))
  58. Expect(valjean.Holds(ctx)).To(BeEmpty())
  59. }, SpecTimeout(time.Second * 10))
  60. })
  61. })
  62. When("the library does not have the book in question", func() {
  63. It("tells the reader the book is unavailable", func(ctx SpecContext) {
  64. err := valjean.Checkout(ctx, library, "Les Miserables")
  65. Expect(err).To(MatchError("Les Miserables is not in the library catalog"))
  66. }, SpecTimeout(time.Second * 5))
  67. })
  68. })
  69. ```
  70. Jump to the [docs](https://onsi.github.io/ginkgo/) to learn more. It's easy to [bootstrap](https://onsi.github.io/ginkgo/#bootstrapping-a-suite) and start writing your [first specs](https://onsi.github.io/ginkgo/#adding-specs-to-a-suite).
  71. If you have a question, comment, bug report, feature request, etc. please open a [GitHub issue](https://github.com/onsi/ginkgo/issues/new), or visit the [Ginkgo Slack channel](https://app.slack.com/client/T029RQSE6/CQQ50BBNW).
  72. ## Capabilities
  73. Whether writing basic unit specs, complex integration specs, or even performance specs - Ginkgo gives you an expressive Domain-Specific Language (DSL) that will be familiar to users coming from frameworks such as [Quick](https://github.com/Quick/Quick), [RSpec](https://rspec.info), [Jasmine](https://jasmine.github.io), and [Busted](https://lunarmodules.github.io/busted/). This style of testing is sometimes referred to as "Behavior-Driven Development" (BDD) though Ginkgo's utility extends beyond acceptance-level testing.
  74. With Ginkgo's DSL you can use nestable [`Describe`, `Context` and `When` container nodes](https://onsi.github.io/ginkgo/#organizing-specs-with-container-nodes) to help you organize your specs. [`BeforeEach` and `AfterEach` setup nodes](https://onsi.github.io/ginkgo/#extracting-common-setup-beforeeach) for setup and cleanup. [`It` and `Specify` subject nodes](https://onsi.github.io/ginkgo/#spec-subjects-it) that hold your assertions. [`BeforeSuite` and `AfterSuite` nodes](https://onsi.github.io/ginkgo/#suite-setup-and-cleanup-beforesuite-and-aftersuite) to prep for and cleanup after a suite... and [much more!](https://onsi.github.io/ginkgo/#writing-specs).
  75. At runtime, Ginkgo can run your specs in reproducibly [random order](https://onsi.github.io/ginkgo/#spec-randomization) and has sophisticated support for [spec parallelization](https://onsi.github.io/ginkgo/#spec-parallelization). In fact, running specs in parallel is as easy as
  76. ```bash
  77. ginkgo -p
  78. ```
  79. By following [established patterns for writing parallel specs](https://onsi.github.io/ginkgo/#patterns-for-parallel-integration-specs) you can build even large, complex integration suites that parallelize cleanly and run performantly. And you don't have to worry about your spec suite hanging or leaving a mess behind - Ginkgo provides a per-node `context.Context` and the capability to interrupt the spec after a set period of time - and then clean up.
  80. As your suites grow Ginkgo helps you keep your specs organized with [labels](https://onsi.github.io/ginkgo/#spec-labels) and lets you easily run [subsets of specs](https://onsi.github.io/ginkgo/#filtering-specs), either [programmatically](https://onsi.github.io/ginkgo/#focused-specs) or on the [command line](https://onsi.github.io/ginkgo/#combining-filters). And Ginkgo's reporting infrastructure generates machine-readable output in a [variety of formats](https://onsi.github.io/ginkgo/#generating-machine-readable-reports) _and_ allows you to build your own [custom reporting infrastructure](https://onsi.github.io/ginkgo/#generating-reports-programmatically).
  81. Ginkgo ships with `ginkgo`, a [command line tool](https://onsi.github.io/ginkgo/#ginkgo-cli-overview) with support for generating, running, filtering, and profiling Ginkgo suites. You can even have Ginkgo automatically run your specs when it detects a change with `ginkgo watch`, enabling rapid feedback loops during test-driven development.
  82. And that's just Ginkgo! [Gomega](https://onsi.github.io/gomega/) brings a rich, mature, family of [assertions and matchers](https://onsi.github.io/gomega/#provided-matchers) to your suites. With Gomega you can easily mix [synchronous and asynchronous assertions](https://onsi.github.io/ginkgo/#patterns-for-asynchronous-testing) in your specs. You can even build your own set of expressive domain-specific matchers quickly and easily by composing Gomega's [existing building blocks](https://onsi.github.io/ginkgo/#building-custom-matchers).
  83. Happy Testing!
  84. ## Using Ginkgo with Claude Code
  85. Ginkgo ships a set of [Claude Code](https://claude.com/claude-code) skills as a plugin, with this repo doubling as the marketplace, so an agent writing specs in *your* project has Ginkgo's idioms, decorators, and gotchas on hand. From inside Claude Code:
  86. ```
  87. /plugin marketplace add onsi/ginkgo
  88. /plugin install ginkgo@ginkgo
  89. ```
  90. (or non-interactively: `claude plugin marketplace add onsi/ginkgo` then `claude plugin install ginkgo@ginkgo`)
  91. This installs a family of `ginkgo:*` skills that activate automatically while you write and run specs. Start with `ginkgo:overview`; see the [plugin README](plugins/ginkgo/README.md) for the full list.
  92. ## License
  93. Ginkgo is MIT-Licensed
  94. ## Contributing
  95. See [CONTRIBUTING.md](CONTRIBUTING.md)
  96. ## Sponsors
  97. Sponsors commit to a [sponsorship](https://github.com/sponsors/onsi) for a year. If you're an organization that makes use of Ginkgo please consider becoming a sponsor!
  98. <p style="font-size:21px; color:black;">Browser testing via
  99. <a href="https://www.testmuai.com/?utm_medium=sponsor&utm_source=ginkgo" target="_blank">
  100. <picture>
  101. <source media="(prefers-color-scheme: dark)" srcset="docs/images/testmu-ai-dark.svg">
  102. <img alt="TestMu AI" src="docs/images/testmu-ai.svg" style="vertical-align: middle;" width="250" />
  103. </picture>
  104. </a>
  105. </p>

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.