Summer Sale! All accounts are 50% off this week.

Toufik94's avatar

Best way to start testing as a beginner?

Hi guys,

The title says it all. I'm a complete newbie in the world of testing. I did some testing when I was a student at school using Sellenium, but back then it was just a tool that you could install as a .exe file and then you could tell it what buttons to trigger or what to type in. It was literally a small robot.

Nowadays we have all these packages and frameworks to install in our web projects to use testing. I know for once that Laravel has it's own testing mechanism which I saw works great for testing Blade-files. But what if I use a different front-end like Vue or React? Does Laravel ship with some tool that helps me in creating unit tests/automated tests for this kind of purposes?

There are like a billion libraries out there which is overwhelming for a newbie like me. I need some guidance by people who are more experienced in this world. Also I noticed some of those libraries are really cumbersome; you have to import and install dozens of (sub)-packages and edit your package.json and webpack script in order to make it work. Isn't there something more user-friendly out there?

0 likes
7 replies
Tray2's avatar

I would suggest using laravel and pest, there are several courses on Laracasts that covers testing (mostly phpunit) and there is also a really good course on testing with pest created by Christof Rumpel.

We are talking about TDD in php right?

Toufik94's avatar

@Tray2 Hi there, not necessairly in PHP because I know Laravel has its own testing mechanism. I was talking about tests in Laravel when using Vue or React as your frontend. I did came across a Laracast course but that guy used the vue-utils-tools in combination with Mocha. I recall that it was the same guy (Christof Rumpell) but in his course he did say that this way of testing could be a bit overwhelming for beginners as you have to install, import and configure a lot of stuff before you can start testing your Vue-frontend in Laravel.

Worth to note: that course is a couple of years old so maybe things have changed meanwhile.

Tray2's avatar

@Toufik94 There are many tools for testing the front end, Cypress is one of those, and there is a course here n how it works. Yes some of the courses are a bit dated, but how you test hasn't changed that much, some things might not work exactly the same depending on versions, but in general there isn't that much different.

Toufik94's avatar

@Tray2 Christoff did mention in one of his courses that he hoped that Javascript testing would become easier for beginners in the future. Like just npm install a bunch of things or use an artisan commando that makes our Laravel project ready for Javascript testing. Do you know by any chance whether something like this is already developed or does it still require some hand work to prepare your project?

Tray2's avatar

@Toufik94 Sorry I don't, I still consider JavaScript to be a front end only language.

Toufik94's avatar

When Googling test libraries, I came across Jest, Mocha en Cypress as the most known ones. I have to look into these to see what works for me. I want the most user-friendly one.

Please or to participate in this conversation.