Skip to content

Commit

Permalink
fix error & crlf
Browse files Browse the repository at this point in the history
  • Loading branch information
pushkine committed May 28, 2020
1 parent d7708c5 commit 86323ad
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions test/js/update.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ glob('samples/*/input.svelte', { cwd: __dirname })
`${__dirname}/${file.replace('input.svelte', 'expected.js')}`,
svelte
.compile(
readFileSync(`${__dirname}/${file}`, 'utf-8').replace(/\s+$/, ''),
readFileSync(`${__dirname}/${file}`, 'utf-8').replace(/\s+$/, '').replace(/\r/g, ''),
loadConfig(`${__dirname}/${file.replace('input.svelte', '_config.js')}`).options
)
.js.code.replace(/generated by Svelte v\d+\.\d+\.\d+(-\w+\.\d+)?/, 'generated by Svelte vX.Y.Z')
.js.code.replace(/generated by Svelte v\d+\.\d+\.\d+(-\w+\.\d+)?/, 'generated by Svelte vX.Y.Z').replace(/\r/g, '')
);
});
4 changes: 2 additions & 2 deletions test/parser/update.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ glob('samples/*/input.svelte', { cwd: __dirname })
writeFileSync(
`${__dirname}/${file.replace('input.svelte', 'output.json')}`,
JSON.stringify(
svelte.compile(readFileSync(`${__dirname}/${file}`, 'utf-8').replace(/\s+$/, ''), { generate: false }).ast,
svelte.compile(readFileSync(`${__dirname}/${file}`, 'utf-8').replace(/\s+$/, '').replace(/\r/g, ''), { generate: false }).ast,
null,
'\t'
)
Expand All @@ -26,7 +26,7 @@ glob('samples/*/input.svelte', { cwd: __dirname })
if (e.name !== 'ParseError') throw e;
writeFileSync(
`${__dirname}/${file.replace('input.svelte', 'error.json')}`,
JSON.stringify({ ...e, message: e.message }, null, '\t')
JSON.stringify({ code:e.code, message: e.message, pos:e.pos, start:e.start, end:e.end }, null, '\t')
);
}
});

0 comments on commit 86323ad

Please sign in to comment.