Chiedo Labs Web Development Harrisonburg VA & Charlottesville VA web design
Picture of Ricardo

Making my tests pass and fail properly using mocha and ansync/ await.


Recently I was adding tests to an app written in node and express. The app utilizes mocha for testing. The previously written tests, which used Promises, were working well. We had recently upgraded node for the app so I wanted to write my new tests with Async / Await. I don’t get into the details […]

Read more

Picture of Don

Why You Should Define Components Outside of The React Render Method


I just discovered a very annoying bug that took me half an hour to figure out. Here’s what I discovered: NEVER define React components (even dumb stateless components) inside of the React render() method. I had an input field that would lose focus as soon as its value changed. So the user could only enter one […]

Read more

Picture of Chiedo

How to Test a NodeJS REST API With Mocha


Over the past few months, we’ve been getting really into Node here at Chiedo Labs. And man, it’s powerful. With that being said, you know how the saying goes. With great power comes great responsibility. If you’re not writing tests for your code, it’s quite arguable that you aren’t being responsible. So we stopped being […]

Read more