Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use gomega test the http request #552

Open
nodece opened this issue Jan 5, 2022 · 0 comments
Open

Use gomega test the http request #552

nodece opened this issue Jan 5, 2022 · 0 comments
Assignees

Comments

@nodece
Copy link
Contributor

nodece commented Jan 5, 2022

Enhancement

Both testify and gomega are test libraries, it can help developers use this to assert data on the test case, but the testify is not friendly on asynchronous assertions way, so I found gomega is a great library on this way, you can find this documentation here, a simple test so like:

    Eventually(func(g Gomega) {
        model, err := client.Find(1138)
        g.Expect(err).NotTo(HaveOccurred())
        g.Expect(model.Reticulate()).To(Succeed())
        g.Expect(model.IsReticulated()).To(BeTrue())
        g.Expect(model.Save()).To(Succeed())
    }).Should(Succeed())

We need this way to test the topic/namespace commands, and assert is simple.

@nodece nodece self-assigned this Jan 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant