Comparing version 0.0.1 to 0.0.2
@@ -43,3 +43,3 @@ /** | ||
if (!path.existsSync(dirIn)) { | ||
callback(new Error('The input directory does not exist.')); | ||
return callback(new Error('The input directory does not exist (' + dirIn + ').')); | ||
} | ||
@@ -49,3 +49,3 @@ // If dirOut does not exist, try to create it. | ||
if (!mkdirp.sync(dirOut)) { | ||
callback(new Error('Could not create the output directory.')); | ||
return callback(new Error('Could not create the output directory (' + dirOut + ').')); | ||
} | ||
@@ -56,3 +56,3 @@ } | ||
if (!cons[options.engine]) { | ||
callback(new Error('The templating engine `' + options.engine + '` does not exist.')); | ||
return callback(new Error('The templating engine `' + options.engine + '` does not exist.')); | ||
} | ||
@@ -59,0 +59,0 @@ |
@@ -6,3 +6,3 @@ { | ||
"keywords": ["scaffold", "cli", "copy", "file", "directory", "directories"], | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"homepage": "http://cantina.github.com", | ||
@@ -9,0 +9,0 @@ "repository": { |
@@ -71,2 +71,23 @@ /** | ||
}); | ||
describe('Error Conditions', function() { | ||
it('should error on a bad input directory', function(done) { | ||
dirIn = path.join(__dirname, 'fixtures/bad'); | ||
hardhat.scaffold(dirIn, dirOut, function(err) { | ||
assert.ok(err, 'An error was not present.') | ||
assert.equal(err.message.indexOf('The input directory does not exist'), 0, 'An incorrect error message was observed.') | ||
done(); | ||
}); | ||
}); | ||
it('should error on a bad templating engine', function(done) { | ||
dirIn = path.join(__dirname, 'fixtures/plain'); | ||
hardhat.scaffold(dirIn, dirOut, {engine: 'bad'}, function(err) { | ||
assert.ok(err, 'An error was not present.') | ||
assert.equal(err.message.indexOf('The templating engine'), 0, 'An incorrect error message was observed.') | ||
done(); | ||
}); | ||
}); | ||
}); | ||
}); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
22801
188