Creating tests for Rematch models
Tip
Before getting started with this section, I recommend taking a first look at the Jest documentation, https://jestjs.io, and discovering which assertions are available to understand this chapter even more. Along the chapter we'll explain in detail what they do and how Jest simplifies the testing process.
To get started, take a look at this code, which will be the pattern that we'll reuse for our tests:
describe("Describe the suite", () => { Â Â beforeEach(() => {}) Â Â beforeAll(() => {}) Â Â afterEach(() => {}) Â Â afterAll(() => {}) Â Â it("should do ...", () => { Â Â Â Â expect(1).toEqual(1) Â Â }) })
In all the tests that we are going to create, we'll define the describe()
method, which allows us to gather our tests into separate groupings within the same file. In this way, we can describe the component name and just...