5.0.0 • Published 5 years ago

ember-sinon v5.0.0

Weekly downloads
60,468
License
MIT
Repository
github
Last release
5 years ago

Ember Sinon

Greenkeeper badge

Build Status Ember Observer Score Code Climate Codacy Badge

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

Compatibility

  • Ember.js v3.12 or above
  • Ember CLI v2.13 or above
  • Node.js v10 or above

Installation

ember install ember-sinon

Usage

While in testing mode (i.e. either when visiting /tests or when running ember test), sinon will be available as an import.

import sinon from 'sinon';

test(".runCallback() should run the callback passed", function(assert) {
  var spy = sinon.spy();
  this.subject().runCallback(spy);

  // Default Sinon messages:
  sinon.assert.calledOnce(spy);
  sinon.assert.calledWith(spy, 'foo');

  // Custom messages:
  assert.ok(spy.calledOnce, "the callback should be called once");
  assert.ok(spy.calledWith('foo'), "the callback should be passed 'foo' as an argument");
});

Integration with testing frameworks

Check out ember-sinon-qunit for integration with Ember-QUnit!

Contributing

See the Contributing guide for details.

License

This project is licensed under the MIT License.

5.0.0

5 years ago

4.1.1

6 years ago

4.1.0

6 years ago

4.0.0

6 years ago

3.1.0

7 years ago

3.0.0

7 years ago

2.2.0

7 years ago

2.1.0

7 years ago

2.0.0

7 years ago

1.0.1

8 years ago

1.0.0

8 years ago

0.7.0

8 years ago

0.6.0

9 years ago

0.5.1

9 years ago

0.5.0

9 years ago

0.4.0

9 years ago

0.3.0

10 years ago

0.2.2

10 years ago

0.2.1

10 years ago

0.2.0

10 years ago

0.1.1

10 years ago

0.1.0

10 years ago

0.0.3

11 years ago

0.0.2

11 years ago

0.0.1

11 years ago