| 123456789101112131415161718192021 |
- const templateMinify = require("../minifyTemplate.js")
- test('Test Empty string', () => {
- expect(templateMinify("")).toBe("");
- });
- test('Test simple html string', () => {
- expect(templateMinify("html`\r\r\n <div> html test\r</div> `",{collapseWhitespace: true}))
- .toBe("html`<div>html test</div>`;");
- });
- test('Test simple css string', () => {
- expect(templateMinify("css`.className{\r\n\tborder-width : 8px;\r\n}`",{collapseWhitespace: true,minifyCSS:true}))
- .toBe("css`.className{border-width:8px}`;");
- });
- test('Test simple svg string', () => {
- expect(templateMinify('svg`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" height="24" width="24">\r\n<path d="M0 0h24v24H0z"/>\r\n</svg>`',{collapseWhitespace: true}))
- .toBe('svg`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" height="24" width="24"><path d="M0 0h24v24H0z"/></svg>`;');
- });
|