Skip to content

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

License

Notifications You must be signed in to change notification settings

abyx/angular-stub-changes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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

About

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

Resources

License

Stars

Watchers

Forks

Packages

No packages published