A stub implementation of the $onChanges changes object for easier testing
JavaScript
Latest commit 17d1933 Jan 30, 2017 @abyx 1.0.2
Permalink
Failed to load latest commit information.
LICENSE Initial commit Jan 13, 2017
README.md Actual implementation Jan 13, 2017
index.js Add support for testing in the browser Jan 30, 2017
package.json 1.0.2 Jan 30, 2017

README.md

angular-stub-changes

A stub implementation of the $onChanges changes object for easier testing.

var StubChanges = require('angular-stub-changes');

var changes = new StubChanges().addInitialChange('foo', 123).addChange('baz', 'aaa', 'bbb').build();

changes.foo.isFirstChange(); // <- true
changes.baz.isFirstChange(); // <- false

changes.foo.currentValue; // <- 123

changes.baz.currentValue;  // <- 'aaa'
changes.baz.previousValue; // <- 'bbb'

Installation

npm install --save-dev angular-stub-changes