0
0
mirror of https://github.com/sveltejs/svelte.git synced 2024-11-25 17:19:22 +01:00

normalize paths in comments in cli tests

This commit is contained in:
Conduitry 2018-05-17 14:30:07 -04:00
parent bd1884a953
commit 860a117f0e

View File

@ -9,7 +9,10 @@ const cli = path.resolve(__dirname, "../../cli/index.ts.js");
function normalize(str) {
return str
.replace(/^\s+$/gm, '')
.replace(/generated by Svelte v[.\d]+/, `generated by Svelte vx.y.z`)
.replace(
/\/\*(.*?)generated by Svelte v[.\d]+/,
(_, path) => `/*${path.replace(/\\/g, '/')}generated by Svelte vx.y.z`
)
.trim();
}