@@ -17,6 +17,7 @@ var fs = require('fs-extra');
17
17
var stripJsonComments = require ( 'strip-json-comments' ) ;
18
18
19
19
// Verify that `.npmscriptrc` exists.
20
+ /* istanbul ignore next */
20
21
try
21
22
{
22
23
if ( ! fs . statSync ( './.npmscriptrc' ) . isFile ( ) )
@@ -30,6 +31,7 @@ catch(err)
30
31
}
31
32
32
33
// Verify that `Babel` exists.
34
+ /* istanbul ignore next */
33
35
try
34
36
{
35
37
if ( ! fs . statSync ( './node_modules/.bin/babel' ) . isFile ( ) )
@@ -46,6 +48,7 @@ catch(err)
46
48
var configInfo = JSON . parse ( stripJsonComments ( fs . readFileSync ( './.npmscriptrc' , 'utf-8' ) ) ) ;
47
49
48
50
// Verify that `build` entry is an object.
51
+ /* istanbul ignore if */
49
52
if ( typeof configInfo . build !== 'object' )
50
53
{
51
54
throw new Error (
@@ -54,6 +57,7 @@ if (typeof configInfo.build !== 'object')
54
57
55
58
56
59
// Verify that `build.babel` entry is an object.
60
+ /* istanbul ignore if */
57
61
if ( typeof configInfo . build . babel !== 'object' )
58
62
{
59
63
throw new Error (
@@ -63,6 +67,7 @@ if (typeof configInfo.build.babel !== 'object')
63
67
var babelConfig = configInfo . build . babel ;
64
68
65
69
// Verify that source entry is a string.
70
+ /* istanbul ignore if */
66
71
if ( typeof babelConfig . source !== 'string' )
67
72
{
68
73
throw new Error (
@@ -71,6 +76,7 @@ if (typeof babelConfig.source !== 'string')
71
76
}
72
77
73
78
// Verify that destination entry is a string.
79
+ /* istanbul ignore if */
74
80
if ( typeof babelConfig . destination !== 'string' )
75
81
{
76
82
throw new Error (
@@ -79,6 +85,7 @@ if (typeof babelConfig.destination !== 'string')
79
85
}
80
86
81
87
// Verify that source entry is a directory.
88
+ /* istanbul ignore next */
82
89
try
83
90
{
84
91
if ( ! fs . statSync ( babelConfig . source ) . isDirectory ( ) )
@@ -95,6 +102,7 @@ catch(err)
95
102
fs . emptyDirSync ( babelConfig . destination ) ;
96
103
97
104
// Verify that destination entry is a directory.
105
+ /* istanbul ignore next */
98
106
try
99
107
{
100
108
if ( ! fs . statSync ( babelConfig . destination ) . isDirectory ( ) )
@@ -113,6 +121,7 @@ var exec = './node_modules/.bin/babel ' + babelConfig.source + ' -d ' + babelCon
113
121
// Add any optional parameters.
114
122
if ( typeof babelConfig . options !== 'undefined' )
115
123
{
124
+ /* istanbul ignore if */
116
125
if ( ! Array . isArray ( babelConfig . options ) )
117
126
{
118
127
throw new Error (
0 commit comments