From c34842b8c1e312d8e7aebf468eee41225c9453ee Mon Sep 17 00:00:00 2001 From: Rich Harris Date: Wed, 4 Jan 2017 14:07:05 -0500 Subject: [PATCH] fail CI if any tests have solo: true --- test/generate.js | 4 ++++ test/parse.js | 4 ++++ test/sourcemaps.js | 4 ++++ test/ssr.js | 4 ++++ test/validate.js | 4 ++++ 5 files changed, 20 insertions(+) diff --git a/test/generate.js b/test/generate.js index 3db6ea0d4c..384bd95b84 100644 --- a/test/generate.js +++ b/test/generate.js @@ -49,6 +49,10 @@ describe( 'generate', () => { const config = loadConfig( dir ); + if ( config.solo && process.env.CI ) { + throw new Error( 'Forgot to remove `solo: true` from test' ); + } + ( config.skip ? it.skip : config.solo ? it.only : it )( dir, () => { let compiled; diff --git a/test/parse.js b/test/parse.js index dc4d8f2e6a..166a17609b 100644 --- a/test/parse.js +++ b/test/parse.js @@ -8,6 +8,10 @@ describe( 'parse', () => { const solo = exists( `test/parser/${dir}/solo` ); + if ( solo && process.env.CI ) { + throw new Error( 'Forgot to remove `solo: true` from test' ); + } + ( solo ? it.only : it )( dir, () => { const input = fs.readFileSync( `test/parser/${dir}/input.html`, 'utf-8' ).replace( /\s+$/, '' ); diff --git a/test/sourcemaps.js b/test/sourcemaps.js index 3417681629..bafaf11a8a 100644 --- a/test/sourcemaps.js +++ b/test/sourcemaps.js @@ -10,6 +10,10 @@ describe( 'sourcemaps', () => { const solo = exists( `test/sourcemaps/${dir}/solo` ); + if ( solo && process.env.CI ) { + throw new Error( 'Forgot to remove `solo: true` from test' ); + } + ( solo ? it.only : it )( dir, () => { const input = fs.readFileSync( `test/sourcemaps/${dir}/input.html`, 'utf-8' ).replace( /\s+$/, '' ); const { code, map } = svelte.compile( input ); diff --git a/test/ssr.js b/test/ssr.js index 828b10c797..ebac203de3 100644 --- a/test/ssr.js +++ b/test/ssr.js @@ -26,6 +26,10 @@ describe( 'ssr', () => { const solo = exists( `test/server-side-rendering/${dir}/solo` ); + if ( solo && process.env.CI ) { + throw new Error( 'Forgot to remove `solo: true` from test' ); + } + ( solo ? it.only : it )( dir, () => { const component = require( `./server-side-rendering/${dir}/main.html` ); diff --git a/test/validate.js b/test/validate.js index 6708074338..1545d51701 100644 --- a/test/validate.js +++ b/test/validate.js @@ -8,6 +8,10 @@ describe( 'validate', () => { const solo = exists( `test/validator/${dir}/solo` ); + if ( solo && process.env.CI ) { + throw new Error( 'Forgot to remove `solo: true` from test' ); + } + ( solo ? it.only : it )( dir, () => { const filename = `test/validator/${dir}/input.html`; const input = fs.readFileSync( filename, 'utf-8' ).replace( /\s+$/, '' );