Getting Started - Jasmine

A quick intro to get started with Chimp and Jasmine

Follow the Installation instructions here.

1. Develop

To start developing using Jasmine, you have to start Chimp with the --jasmine flag like this:

chimp --jasmine --watch

Chimp will watch your features directory for any .js files and rerun any describe/it blocks that contain the string @watch. For example:

describe('Chimp Jasmine', function() {
  describe('Page title', function () {
    it('should be set by the Meteor method @watch', function () {
      browser.url('http://www.google.com');
      expect(browser.getTitle()).toEqual('Google');
    });
  });
});

Make sure that your spec files end with "_spec", "-spec" or "Spec".

By default, Chimp starts a Google Chrome browser window. This is where your specs will run and you can use this window to see the automation as it happens. Chimp also ensures the same window will remain open between your specs rerunning so you won't get an annoying window popup.

The watch mode is designed to keep you focused on the task at hand. The idea is you work on a scenario through to completion, and then move the @watch tag to the next spec you are working on.

You can see this mode in action in the demo video

2. Test

You've now finished your tasks and are ready to commit your code. If you want to run the build locally you can run all the tests using this command:

chimp --jasmine

Chimp recognizes that you're not in watch mode and will run all the specs.

This same command can also be used on CI servers.

3. Learn more

You can find more info on the Jasmine support page.



##Learn the Fundamentals of Testing, Specifications and Become a Chimp Ninja!
Checkout our new book where you can learn how to can use Chimp across the Full Stack from JASMINE to React, Node.JS, Mocha, Meteor and more.

Quality, Faster. By Sam Hatoum, creator of Chimp.