return promise, so that test results are correct

pull/969/head
Rich Harris 7 years ago
parent 16599690a5
commit 69b74d96bc

@ -31,7 +31,7 @@ function checkCodeIsValid(code) {
} }
} }
describe('preprocess', () => { describe.only('preprocess', () => {
fs.readdirSync('test/preprocess/samples').forEach(dir => { fs.readdirSync('test/preprocess/samples').forEach(dir => {
if (dir[0] === '.') return; if (dir[0] === '.') return;
@ -51,9 +51,9 @@ describe('preprocess', () => {
fs.readFileSync(`test/preprocess/samples/${dir}/input.html`, fs.readFileSync(`test/preprocess/samples/${dir}/input.html`,
'utf-8').replace(/\s+$/, ''); 'utf-8').replace(/\s+$/, '');
svelte.preprocess(input, config). return svelte.preprocess(input, config)
then(processed => processed.toString()). .then(processed => processed.toString())
then(processed => { .then(processed => {
const expectedWarnings = (config.warnings || []).map( const expectedWarnings = (config.warnings || []).map(
normalizeWarning); normalizeWarning);
@ -153,8 +153,6 @@ describe('preprocess', () => {
throw err; throw err;
} }
} }
}).catch(error => {
throw error;
}); });
}); });
}); });

Loading…
Cancel
Save