From 3d464054814d8f5fee280b034f6904cf1f18f4eb Mon Sep 17 00:00:00 2001 From: Tan Li Hau Date: Thu, 7 Nov 2019 00:55:07 +0800 Subject: [PATCH] skip missing input files --- test/js/index.js | 7 +++++-- test/parser/index.js | 4 +++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/test/js/index.js b/test/js/index.js index 5fd632d606..411a015276 100644 --- a/test/js/index.js +++ b/test/js/index.js @@ -14,8 +14,11 @@ describe("js", () => { throw new Error("Forgot to remove `solo: true` from test"); } - (solo ? it.only : it)(dir, () => { - dir = path.resolve(`${__dirname}/samples`, dir); + dir = path.resolve(`${__dirname}/samples`, dir); + + const skip = !fs.existsSync(`${dir}/input.svelte`); + + (skip ? it.skip : solo ? it.only : it)(dir, () => { const config = loadConfig(`${dir}/_config.js`); const input = fs.readFileSync(`${dir}/input.svelte`, "utf-8").replace(/\s+$/, ""); diff --git a/test/parser/index.js b/test/parser/index.js index 0188fac431..3306785591 100644 --- a/test/parser/index.js +++ b/test/parser/index.js @@ -15,7 +15,9 @@ describe('parse', () => { ); } - (solo ? it.only : it)(dir, () => { + const skip = !fs.existsSync(`${__dirname}/samples/${dir}/input.svelte`); + + (skip ? it.skip : solo ? it.only : it)(dir, () => { const options = tryToLoadJson(`${__dirname}/samples/${dir}/options.json`) || {}; const input = fs.readFileSync(`${__dirname}/samples/${dir}/input.svelte`, 'utf-8').replace(/\s+$/, '');