simplabs/ember-sinon

Name: ember-sinon

Owner: simplabs

Description: Ember CLI addon adding support for sinon.js

Created: 2015-05-20 19:13:00.0

Updated: 2015-05-20 19:13:01.0

Pushed: 2015-05-20 19:49:38.0

Homepage: null

Size: 97

Language: JavaScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Ember-sinon

This addon adds support for Sinon to assist in testing your Ember CLI app.

Installation

If you are using Ember CLI 0.1.5 or higher:

r install:addon ember-sinon

otherwise:

install --save-dev ember-sinon
r g ember-sinon
Usage

While in testing mode (i.e. either when visiting /tests or when running ember test), sinon will be available in the global namespace. You can use it normally:

(".runCallback() should run the callback passed", function(assert) {
r spy = sinon.spy();
is.subject().runCallback(spy);
sert.ok(spy.calledOnce, "the callback should be called once");
sert.ok(spy.calledWith('foo'), "the callback should be passed 'foo' as an argument");


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.