angular-stub-changes

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

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
angular-stub-changes
1301.0.27 years ago7 years agoMinified + gzip package size for angular-stub-changes in KB

Readme

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