Stefano Magni
1 min readJun 28, 2019

--

First of all: THANK YOU for sharing, this is one of the best online resources about the topic, congratulations!!
One question, chapter “Adding Todo”: why do you use a stub to check for the request body?

Your example is

```

cy.wait(“@sync”).then(() => {
expect(reqStub.args[0][0].request.body).to.eql([<PARAMS>]);
});
```

While you could (if I’m not wrong)
```

cy.wait(“@sync”).then(xhr => {
expect(xhr.request.body).to.eql(<PARAMS>)
})
```

avoiding the stub at all?

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

Stefano Magni
Stefano Magni

Written by Stefano Magni

I’m a passionate, positive-minded Senior Front-end Engineer and Team Leader, a speaker, and an instructor. Working remotely since 2018.

Responses (1)

Write a response