Skip to content

Latest commit

 

History

History
23 lines (15 loc) · 545 Bytes

README.md

File metadata and controls

23 lines (15 loc) · 545 Bytes

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