Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
it('transforms html file', function () {
const html = '<template></template>';
const expected = `import { CustomElement } from '@aurelia/runtime';
export const name = "foo-bar";
export const template = "<template></template>";
export default template;
export const dependencies = [ ];
let _e;
export function getHTMLOnlyElement() {
if (!_e) {
_e = CustomElement.define({ name, template, dependencies });
}
return _e;
}
`;
const result = preprocess({ path: path.join('src', 'foo-bar.html'), contents: html }, {}, () => false);
assert.equal(result.code, expected);
assert.equal(result.map.version, 3);
});