Front end testing


I’ve got the quality assurance certification but I’m stuck setting up tests.
I would like to test the front end of an application I’m putting together in electron.js

I want to test stuff that does NOT pass through the server and interacts with the user. Just the front end (vanilla stuff mostly) At first it was no problem but it’s gotten so big that I feel I need ‘regressive tests’ (a term I found on the net, i.e. I change something and all the code goes nuts in every file I’ve written) . And just test everything because I overlook things and much later I bump into issues. I’d like to be a little more structured in my approach.

I did find Ahmed Bouchefra’s article on Jasmin. I started reading with much enthusiasm and then I got stuck because:

Now, create a folder for your project and navigate inside it:

$ mkdir jasmine-project $ cd jasmine-project

Next, run the following command to initialize your project for Jasmine:

This command simply creates a spec folder and a JSON configuration file. This is the output of the dir command:

What command? There is no following command. He must have forgotten to add it.
I tried to send him a message on twitter but I’m not allowed to.

Could you give me some helpful tips? Electron offers testing but as I’ve understood it it tests data going to and from the server. I just want to test my front end.
I enjoyed mocha and chai very much but can that be used for my purpose? I find tools like Jasmin and Jest, but the lingo used is a bit much for me. Maybe I’m making it bigger than it is (wouldn’t be the first time) but I feel overwhelmed and I don’t know how to set it up.

Any help is welcome.

Thanks and greets,

Hi Randell,

I found it on freecodecamp using the search bar. Enter jasmin and there it is.
There 's an article though that resembles his a lot and I think I have found the command :
npx jasmine init
That article is found on Jasmine Unit Testing Tutorial: A Comprehensive Guide
but Ahmed’s article is a lot more detailed.
I have found a course on tutorialspoint and I’m trying it out. I have got stuck in the past though and I gave up each time. So I wrote this post.
I do wish to have tests set up this time.

Thanks and greets,

It is just the init command without npx as they want you to install jasmine globally. I would avoid installing packages globally and just keep using npx jasmine init instead.

Original article


Another article

1 Like


For the link and for the answer.
I could have figured it out on my own BUT I have to ask for help first. As soon as I’ve done that solutions fall into my lap and I realize that it’s not so hard after all. Maybe some weight lifts off me because I’m not completely alone with it, I don’t know.

I need to ask.

Thank you for the quick reply, it makes a big difference.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.