Testing with Mocha – 1. Installation and set up
Introduction Mocha can be run both from the command line or from the browser. If you want to run it from the terminal you can use npm or yarn to install it. You can install mocha globally and use it...
View ArticleTesting with Mocha – 2. Using the assert library
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,...
View ArticleTesting with Mocha – 3. Testing asynchronous code
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...
View ArticleTesting with Mocha – 4. Testing error handling
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...
View ArticleTesting with Mocha – 5. BDD style assertions with Chai
Chai is a TDD and BDD library, and comes with several flavors for assertions: should, expect and assert. In the following lessons we will take a look at both styles and see how to use them in practice....
View ArticleUnder the hood: How states work in Laravel factories
Since Laravel 8 we can use the new and reworked model factories. They allow us to create multiple interconnected model instances using a simple and easy to read syntax. As usual Laravel has a great...
View ArticleLet's do TDD (with video)
I am a big fan of Test Driven Development and trying to promote it on every possible occassion. I am doing it because having a good test suite makes me confortable when refactoring or making changes in...
View ArticleLaravel analytics - how and why I made my own analytics package
I've used google analytics for couple of years and it worked quite well for me. The question arises why did I make my own analytics package. There were a couple of reasons to do so:Google analytics...
View ArticlePackage development in Laravel - meetup with video
We've organized a meetup in WDev office on the topic of pakcage development in Laravel. We had great time exploring the following topics:WHAT are PHP packagesWHY should we create packages?HOW to...
View ArticlePlanning poker app - a journey from Vue.js to Express through Socket.IO
In agile development process it is common to use planning poker to determine the story point of the tickets. There are plenty of free planning poker apps out there, but while using those we usually had...
View ArticleHow to implement translations with JetStream, Intertia and Vue3 using Laravel 10
Laravel 10 comes with internationalization support out of the box, however when we use JetStream starter pack with Inertia the transaction support is not included in the Vue part. Luckily it is quite...
View Article
More Pages to Explore .....