4 ms·
Like I mentioned: ``` function setButtonState() { const res = this.fetchSomeResult(); // returns an unfulfilled promise if (res) { return true; }
by nobleach 2y ago
Like I mentioned:
```
function setButtonState() {
const res = this.fetchSomeResult(); // returns an unfulfilled promise
if (res) {
return true;
}
return false;
}
```
as a unit test would quickly fail when you want it to. An E2E test would pass, but for the wrong reasons. This has nothing to do with app state, and everything to do with not being scientific, and testing all sorts of variable things at once just because, "that's what the user sees".
- int_19h 2y agoThe E2E test would test the user-observable behavior that hinges on this function returning true or false. If there's no such observable behavior, then why does it matter? The appeal to "being scientific" doesn't make much sense to me, either. But if you really want to go there, being scientific is all about app state since that's literally all there is to the app.