Skip to content

Instantly share code, notes, and snippets.

@efleming969
Last active August 29, 2015 14:25
Show Gist options
  • Save efleming969/85c40b6878aba06c9b59 to your computer and use it in GitHub Desktop.
Save efleming969/85c40b6878aba06c9b59 to your computer and use it in GitHub Desktop.
it ( 'should calculate the proper value', function () {
var ds = new DataService();
var x = new Foo( ds );
sinon.stub( ds, "lookupMultiplier" ).returns( 2 );
var rst = x.calculateValueBasedOnLookup( 5 );
expect( rst ).to.equal( 10 );
} );
it ( 'should send an email', function () {
var es = new EmailService();
var bar = new Bar( es );
var expectation = sinon.mock( es )
.expects( "send" ).withArgs( "hello" );
bar.somethingThatSendsAnEmail();
expectation.verify();
} );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment