Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
'can instantiate NodeDOMTreeConstruction without a document'() {
// this emulates what happens in Ember when using `App.visit('/', { shouldRender: false });`
let helper = new NodeDOMTreeConstruction(null as any);
this.assert.ok(!!helper, 'helper was instantiated without errors');
}
}
constructor(options) {
super({
appendOperations: new NodeDOMTreeConstruction(options.document),
updateOperations: undefined, // SSR does not have updateOperations
});
setOwner(this, getOwner(options));
}
getElementBuilder(env: Environment, cursor: Cursor): ElementBuilder {
if (cursor.element instanceof Node) {
return debugRehydration(env, cursor);
}
return serializeBuilder(env, cursor);
}
getElementBuilder(env: Environment, cursor: Cursor) {
return serializeBuilder(env, cursor);
}
}
function testOptions(options: NodeEnvironmentOptions) {
let document = options.document;
let appendOperations: Maybe = options && options.appendOperations;
let updateOperations: Maybe = options && options.updateOperations;
if (!appendOperations) {
appendOperations = new NodeDOMTreeConstruction(document);
}
if (!updateOperations) {
updateOperations = new DOMChanges(document as HTMLDocument);
}
return { appendOperations, updateOperations, document };
}
getBuilder(env: Environment): ElementBuilder {
return serializeBuilder(env, this.cursor);
}
}