The general usage of a Backbone class is to use the .extend
method providing an .initialize
method.
var MyView = Backbone.View.extend({
initialize: function () {
// Setup object.
}
# make sure to replace `<hash>` with your gist's hash
git clone https://gist.github.com/<hash>.git # with https
git clone [email protected]:<hash>.git # or with ssh
'use strict'; | |
const sinon = require( 'sinon' ); | |
const expect = require( 'chai' ).expect; | |
describe( 'Array.prototype', () => { | |
describe( 'map()', () => { | |
it( 'uses native map', () => { | |
const callback = sinon.spy(); | |
const stub = sinon.stub( Array.prototype, 'map' ).returns( [ 2, 4 ] ); |