0
0
mirror of https://github.com/sveltejs/svelte.git synced 2024-12-01 17:30:59 +01:00
This commit is contained in:
Conduitry 2018-10-28 21:43:02 -04:00
parent 65b9a5c861
commit e4e4a8d8c2

View File

@ -110,6 +110,42 @@ describe('preprocess', () => {
});
});
it('preprocesses multiple matching tags', () => {
const source = `
<script>
REPLACEME
</script>
<style>
SHOULD NOT BE REPLACED
</style>
<script>
REPLACEMETOO
</script>
`;
const expected = `
<script>
replaceme
</script>
<style>
SHOULD NOT BE REPLACED
</style>
<script>
replacemetoo
</script>
`;
return svelte.preprocess(source, {
script: ({ content }) => {
return {
code: content.toLowerCase()
};
}
}).then(processed => {
assert.equal(processed.toString(), expected);
});
});
it('parses attributes', () => {
const source = `
<style type='text/scss' data-foo="bar" bool></style>