ng2-materialize
Version:
An Angular 2+ wrap around Materialize library
18 lines (17 loc) • 996 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
var testing_1 = require("@angular/core/testing");
var test_wrapper_component_1 = require("./test-wrapper.component");
function buildComponent(template, bindings) {
if (bindings === void 0) { bindings = {}; }
testing_1.TestBed.overrideComponent(test_wrapper_component_1.MzTestWrapperComponent, { set: { template: template, inputs: Object.keys(bindings) } });
return testing_1.TestBed.compileComponents().then(function () {
// Note: we can also use TestComponent.prototype[binding] instead of
// Object.assign; however, using Object.assign more closely matches
// Angular, wherein the inputs are not available on construction.
var fixture = testing_1.TestBed.createComponent(test_wrapper_component_1.MzTestWrapperComponent);
Object.assign(fixture.componentInstance, bindings);
return fixture;
});
}
exports.buildComponent = buildComponent;