From 4f05a22cb334691b03b6505878a20667fad139ca Mon Sep 17 00:00:00 2001 From: Rich Harris Date: Sat, 2 Dec 2017 23:20:43 -0500 Subject: [PATCH] return promise, so that test results are correct --- test/preprocess/index.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/test/preprocess/index.js b/test/preprocess/index.js index 209e81070b..4f59e4fe6b 100644 --- a/test/preprocess/index.js +++ b/test/preprocess/index.js @@ -31,7 +31,7 @@ function checkCodeIsValid(code) { } } -describe('preprocess', () => { +describe.only('preprocess', () => { fs.readdirSync('test/preprocess/samples').forEach(dir => { if (dir[0] === '.') return; @@ -51,9 +51,9 @@ describe('preprocess', () => { fs.readFileSync(`test/preprocess/samples/${dir}/input.html`, 'utf-8').replace(/\s+$/, ''); - svelte.preprocess(input, config). - then(processed => processed.toString()). - then(processed => { + return svelte.preprocess(input, config) + .then(processed => processed.toString()) + .then(processed => { const expectedWarnings = (config.warnings || []).map( normalizeWarning); @@ -153,8 +153,6 @@ describe('preprocess', () => { throw err; } } - }).catch(error => { - throw error; }); }); });