My name is Daniel Werner, I am a senior web developer, TDD and clean code enthusiasts, mostly working in PHP (Laravel) and JavaScript (VueJs, jQuery, vanilla).
I live in Subotica, Serbia working as a developer and manager in my company WDEV doo
Senior Software Developer | TDD and Clean Code enthusiast | Open-source contributor and maintainer
My name is Daniel Werner, I am a senior web developer, TDD and clean code enthusiasts, mostly working in PHP (Laravel) and JavaScript (VueJs, jQuery, vanilla).
I live in Subotica, Serbia working as a developer and manager in my company WDEV doo
Backend development is mostly done in php using the Laravel framework.
The frontend development can be done using a frontend framework (Vue.js or Angular), or simply using jQuery for simpler applications.
I use TDD methodology whenever it is possible (and it is almost always possible!) to ensure that our products are robust and maintainable.
As an enthusiastic developer, I am always hungry for challenging projects.
In this post we will take a look how can we expect that an error is thrown and how to make sure no error is thrown when when everything should be fine. Asserting an error is thrown Let’s take a look on how to make sure the expected error is thrown in case when we …
Continue reading “Testing with Mocha – 4. Testing error handling”
In JavaScript we often write asynchronous code, for example ajax calls, database operations etc. When testing our code we want to be able to test this asynchronous parts of our code as well. Let’s see how we can achieve this when testing with Mocha. Asynchronous code with callbacks For testing async code which uses callbacks …
Continue reading “Testing with Mocha – 3. Testing asynchronous code”
In the previous lesson we’ve created our first test, but used only one assertion to check if the result equals to a predefined value. Let’s take a look at the capabilities of the Chai’s assert library, and explore them through some more advanced examples. Using strictEqual and notStrictEqual In the first example we’ve already used …
Continue reading “Testing with Mocha – 2. Using the assert library”