Skip to Main Content
Cucumber Recipes
book

Cucumber Recipes

by Ian Dees, Matt Wynne, Aslak Hellesoy
February 2013
Intermediate to advanced content levelIntermediate to advanced
272 pages
5h 45m
English
Pragmatic Bookshelf
Content preview from Cucumber Recipes
Recipe 31Drive JavaScript/CoffeeScript Using Cucumber-JS

Problem

You’re testing JavaScript code that’s running either on the server side in a framework like Node.js or in the browser. You’d like to use the familiar Cucumber syntax to drive your JavaScript (or possibly CoffeeScript) code.

Ingredients

  • Cucumber-JS,[196] an implementation of Cucumber written in JavaScript

  • Node.js (or just Node),[197] a JavaScript application framework

  • Node Package Manager,[198] the main way of installing libraries into Node

  • CoffeeScript,[199] a more elegant syntax for JavaScript

Solution

JavaScript runs in a lot of environments, from GUI code in the browser to back-end server frameworks like Node.js. In this recipe, we’re going to write a simple Cucumber test for some ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Cucumber Cookbook

Cucumber Cookbook

Shankar Garg
Basiswissen Softwaretest , 6th Edition

Basiswissen Softwaretest , 6th Edition

Andreas Spillner, Tilo Linz
React Cookbook

React Cookbook

David Griffiths, Dawn Griffiths

Publisher Resources

ISBN: 9781941222607Errata