const templateMinify = require("../minifyTemplate.js") test('Test html string with template', () => { expect(templateMinify("let echo = 1;\r html`\r\r\n
html test ${echo}\r
`",{collapseWhitespace: true})) .toBe("let echo=1;html`
html test ${echo}
`;"); }); test('Test html string with nested template', () => { expect(templateMinify("let echo = 1;\r html`\r\r\n
html test ${echo ? html`
\r\nEcho\r\n
`:``}\r
`",{collapseWhitespace: true})) .toBe("let echo=1;html`
html test ${echo?html`
Echo
`:``}
`;"); }); test('Test html string with template in attribute', () => { expect(templateMinify("let echo = 1;\r html`\r\r\n
html test \r
`",{collapseWhitespace: true})) .toBe("let echo=1;html`
html test
`;"); });