Files
owl/tests/compiler/__snapshots__/comments.test.ts.snap
T
Lucas Perais (lpe) 6ea40a66da [IMP] app, compiler: introduce t-out
t-out automatically escaped content when it is a string not marked
with the `markup` function

t-out renders the raw content if it is a Block, or if it has been marked
with the `markup` funtion.

t-esc has been kept since it is safe and is optimized to render text nodes.

all t-raw calls are in fact the same as t-out.
2021-11-16 14:37:53 +01:00

52 lines
1.7 KiB
Plaintext

// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`comments only a comment 1`] = `
"function anonymous(bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component } = bdom;
let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber, safeOutput } = helpers;
let block1 = createBlock(\`<!-- comment-->\`);
return function template(ctx, node, key = \\"\\") {
return block1();
}
}"
`;
exports[`comments properly handle comments 1`] = `
"function anonymous(bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component } = bdom;
let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber, safeOutput } = helpers;
let block1 = createBlock(\`<div>hello <!-- comment-->owl</div>\`);
return function template(ctx, node, key = \\"\\") {
return block1();
}
}"
`;
exports[`comments properly handle comments between t-if/t-else 1`] = `
"function anonymous(bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component } = bdom;
let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber, safeOutput } = helpers;
let block1 = createBlock(\`<div><block-child-0/><block-child-1/></div>\`);
let block2 = createBlock(\`<span>true</span>\`);
let block3 = createBlock(\`<span>owl</span>\`);
return function template(ctx, node, key = \\"\\") {
let b2,b3;
if (true) {
b2 = block2();
} else {
b3 = block3();
}
return block1([], [b2, b3]);
}
}"
`;