Skip to content

Instantly share code, notes, and snippets.

View mikecx's full-sized avatar

Michael Carey mikecx

View GitHub Profile
import { React, shallow } from 'testHelper';
const sharedSpecs = (component, props) => {
let wrapper;
beforeEach(() => {
const Component = component;
wrapper = shallow(<Component {...{ ...props }} />);
});
Link for later.
@mikecx
mikecx / regions_mixin.js
Created May 22, 2013 19:04
Backbone Marionette Regions Mixin
// Mix regions into Backbone Views that don't have them.
var Mixins = {
Regions: {}
};
Mixins.Regions = function (parent) {
var initialize = parent.prototype.initialize,
render = parent.prototype.render,
close = parent.prototype.close,
functions = ['addRegion', 'addRegions', 'removeRegion', '_buildRegions',