Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions test/__snapshots__/loader.test.js.snap
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`loader should not failed contain invisible spaces: errors 1`] = `Array []`;

exports[`loader should not failed contain invisible spaces: module 1`] = `
"// Exports
module.exports = \\"<ul>\\\\n <li> \\\\\\\\u2028 - 
 </li>\\\\n <li> \\\\\\\\u2029 - 
 </li>\\\\n</ul>\\\\n\\";"
`;

exports[`loader should not failed contain invisible spaces: result 1`] = `
"<ul>
<li> \\\\u2028 - 
 </li>
<li> \\\\u2029 - 
 </li>
</ul>
"
`;

exports[`loader should not failed contain invisible spaces: warnings 1`] = `Array []`;

exports[`loader should not make bad things with templates: errors 1`] = `Array []`;

exports[`loader should not make bad things with templates: module 1`] = `
Expand Down
4 changes: 4 additions & 0 deletions test/fixtures/invisible-space.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<ul>
<li> \u2028 - 
 </li>
<li> \u2029 - 
 </li>
</ul>
3 changes: 3 additions & 0 deletions test/fixtures/invisible-space.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import html from './invisible-space.html';

export default html;
14 changes: 14 additions & 0 deletions test/loader.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,18 @@ describe('loader', () => {
expect(getWarnings(stats)).toMatchSnapshot('warnings');
expect(getErrors(stats)).toMatchSnapshot('errors');
});

it('should not failed contain invisible spaces', async () => {
const compiler = getCompiler('invisible-space.js');
const stats = await compile(compiler);

expect(getModuleSource('./invisible-space.html', stats)).toMatchSnapshot(
'module'
);
expect(
execute(readAsset('main.bundle.js', compiler, stats))
).toMatchSnapshot('result');
expect(getWarnings(stats)).toMatchSnapshot('warnings');
expect(getErrors(stats)).toMatchSnapshot('errors');
});
});