Home / Companies / Semaphore / Blog / Post Details
Content Deep Dive

Setting up Jasmine JavaScript tests for continuous integration

Blog post from Semaphore

Post Details
Company
Date Published
Author
Nebojša Stričević
Word Count
282
Language
English
Hacker News Points
-
Summary

For developers working with JavaScript or CoffeeScript who wish to implement test-driven development (TDD), Jasmine is a popular choice for automatic testing. While there are resources like articles and books to help beginners understand Jasmine, setting up a Jasmine test suite on a continuous integration (CI) server like Semaphore can be less straightforward. The process involves utilizing several tools: Jasmine as the behavior-driven development (BDD) framework, Jasminerice to manage the Rails assets pipeline, Guard::Jasmine for headless testing with PhantomJS, and optionally Sinon.JS for mocking server responses. To integrate Jasmine into your CI workflow, you need to add Jasminerice and Guard::Jasmine to your project's Gemfile, bundle the dependencies, and initialize Guard::Jasmine. With the setup complete, tests can be run using the guard-jasmine command, and Semaphore will generate a test report. Developers are encouraged to explore additional instructions tailored to their project's specific needs and to engage with the community via Discord for further discussion.