ember-qunit-mock

0.0.9 • Public • Published

ember-qunit-mock

NPM Version Build Status

This project is heavily inspired by SinonJS, but aims to providing assertions-friendly mocks in an ember-qunit testing environment.

Use it!

Installation

npm install --save-dev ember-qunit-mock

Mocking methods in tests

import { moduleForComponent } from 'ember-qunit';
import { test } from 'ember-qunit-mock/lib/test';

moduleForComponent('my-component', {});

test('A test using mock', function (assert) {
  var mock = this.mock('MockName');
  mock.expect('someMethod').withArgs('arg', 10).returns(42);

  // Test logic here...
}

Contribute

All contributions are welcome. Submit your PRs!

Get project

  • git clone this repository
  • npm install
  • bower install

Running Tests

  • ember test
  • ember test --server

Building

  • ember build

For more information on using ember-cli, visit http://www.ember-cli.com/.

Readme

Keywords

Package Sidebar

Install

npm i ember-qunit-mock

Weekly Downloads

7

Version

0.0.9

License

MIT

Last publish

Collaborators

  • mike.aski