Just married: Joomla and Jasmine
It is with great excitement I write my first article on my GSoC project with Joomla! I will start off with a bit of an introduction to myself before running into the details of the project.
I'm Thanuditha Ruchiranga Wickramasinghe, currently a final year undergraduate at the Department of Computer Science and Engineering at University of Moratuwa, Sri Lanka. This is my second time as a GSoC student and last year’s GSoC helped me learn a lot of new things which I had never been exposed to and I am pretty sure it is going to be an even better experience this time around with my mentors Ashan Fernando and Yves Hoppe.
The advantage of using Karma is that it is specifically developed to save the developer from the hassles of configuring the testing environment. Joomla! Uses Travis continuous integration service to run tests on GitHub. Every code push or PR made to the repository triggers all the tests to be run. Travis is watching you!
Depending on the test results from Travis, GitHub indicates whether the changes made broke the existing functionality or not. Karma makes setting all these configuration a very simple task. So finally Karma became the matchmaker that stood between Joomla and Jasmine. Following is a simple diagram which elaborates on the idea of the test execution flow.
Following is a screenshot of the Travis build log with all the test cases for the JCaption library passing along with a summary on the test coverage over the set of libraries so far.
An extract of the SPEC code that ran this set of test cases is shown below. The DOM setup happens in a separate file which is dynamically loaded as a dependency here.
P.S: Special thanks go to Elisa Foltyn for helping me with this cool article cover image. :)
By accepting you will be accessing a service provided by a third-party external to https://magazine.joomla.org/