@@ -17,6 +17,7 @@ var fs = require('fs-extra');
1717var stripJsonComments = require ( 'strip-json-comments' ) ;
1818
1919// Verify that `.npmscriptrc` exists.
20+ /* istanbul ignore next */
2021try
2122{
2223 if ( ! fs . statSync ( './.npmscriptrc' ) . isFile ( ) )
@@ -30,6 +31,7 @@ catch(err)
3031}
3132
3233// Verify that `Babel` exists.
34+ /* istanbul ignore next */
3335try
3436{
3537 if ( ! fs . statSync ( './node_modules/.bin/babel' ) . isFile ( ) )
@@ -46,6 +48,7 @@ catch(err)
4648var configInfo = JSON . parse ( stripJsonComments ( fs . readFileSync ( './.npmscriptrc' , 'utf-8' ) ) ) ;
4749
4850// Verify that `build` entry is an object.
51+ /* istanbul ignore if */
4952if ( typeof configInfo . build !== 'object' )
5053{
5154 throw new Error (
@@ -54,6 +57,7 @@ if (typeof configInfo.build !== 'object')
5457
5558
5659// Verify that `build.babel` entry is an object.
60+ /* istanbul ignore if */
5761if ( typeof configInfo . build . babel !== 'object' )
5862{
5963 throw new Error (
@@ -63,6 +67,7 @@ if (typeof configInfo.build.babel !== 'object')
6367var babelConfig = configInfo . build . babel ;
6468
6569// Verify that source entry is a string.
70+ /* istanbul ignore if */
6671if ( typeof babelConfig . source !== 'string' )
6772{
6873 throw new Error (
@@ -71,6 +76,7 @@ if (typeof babelConfig.source !== 'string')
7176}
7277
7378// Verify that destination entry is a string.
79+ /* istanbul ignore if */
7480if ( typeof babelConfig . destination !== 'string' )
7581{
7682 throw new Error (
@@ -79,6 +85,7 @@ if (typeof babelConfig.destination !== 'string')
7985}
8086
8187// Verify that source entry is a directory.
88+ /* istanbul ignore next */
8289try
8390{
8491 if ( ! fs . statSync ( babelConfig . source ) . isDirectory ( ) )
@@ -95,6 +102,7 @@ catch(err)
95102fs . emptyDirSync ( babelConfig . destination ) ;
96103
97104// Verify that destination entry is a directory.
105+ /* istanbul ignore next */
98106try
99107{
100108 if ( ! fs . statSync ( babelConfig . destination ) . isDirectory ( ) )
@@ -113,6 +121,7 @@ var exec = './node_modules/.bin/babel ' + babelConfig.source + ' -d ' + babelCon
113121// Add any optional parameters.
114122if ( typeof babelConfig . options !== 'undefined' )
115123{
124+ /* istanbul ignore if */
116125 if ( ! Array . isArray ( babelConfig . options ) )
117126 {
118127 throw new Error (
0 commit comments