20/03/2016 - 1 minute read

News Flash! You Don't Need node-jasmine to Test node.js Apps with Jasmine

Written by

Gary Lewis Cheetham

Automotive marketing specialist from Manchester, UK

When setting up my test suite for Heroes Of Deep Space, I was tempted to use the previously helpful node-jasmine module.

I'm (at the time of writing) using Jasmine 2.4.1, and with this version I was able to get a gulp test task running without node-jasmine at all. There's even a section in the Jasmine docs for v2.4 on how to configure Jasmine for node.js environments.

Here's the task that I ended up writing:

var Jasmine = require('jasmine');
var gulp = require('gulp');

gulp.task('test', function() {
    var jasmine = new Jasmine();
    jasmine.loadConfig({
      "spec_dir": "./tests/app",
      "spec_files": [
        "**/*.js"
      ],
      "helpers": [
        "helpers/**/*.js"
      ],
      "stopSpecOnExpectationFailure": false,
      "random": false
    });
    jasmine.execute();
});

This is working perfectly for testing my server-side code, and I'm happy that I ended up depending on one less package.

About the author

Gary Lewis Cheetham is an automotive marketing specialist, born and raised in Oldham, Greater Manchester. He spent his teenage years working at the family dealership after school, learning the ropes of the car trade from the inside out.

After moving on to working in marketing, Gary Lewis founded GL Digital in 2020 when he noticed a need for direct-to-consumer marketing platforms within the auto industry. He now strives every day to help independent dealers in the UK and US realise their potential. Gary also loves Formula 1 and motorsport.

More Articles

SEO For Car Dealerships: Everything You Need to Know

SEO For Car Dealerships: Everything You Need to Know

We will be the first to say it: SEO for car dealerships is officially over in 2022. Car dealers fail at SEO time and time again, because…

5 minute read - 07/02/2022

Everything you need to know about Conversion Rate Optimisation for Car dealerships in 2022

Everything you need to know about Conversion Rate Optimisation for Car dealerships in 2022

This article will cover how dealerships can do conversion rate optimisation on their website and sales funnels, including for lead…

6 minute read - 27/01/2022

How to run successful Email Marketing for Car Dealerships in 2022

How to run successful Email Marketing for Car Dealerships in 2022

Email marketing is one of the most effective digital marketing strategies for car dealerships to build relationships with customers. It…

5 minute read - 27/01/2022

See More