Created
January 16, 2014 22:47
-
-
Save johntron/8464997 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var read = require('fs').readFileSync; | |
module.exports = function (builder) { | |
builder.hook('before scripts', function (pkg, next) { | |
var config = pkg.config, | |
tests = config.tests, | |
development = config.development; | |
if (!tests) return next(); | |
tests.forEach(function (test) { | |
var path = pkg.path(test), | |
contents = read(path, 'utf8'); | |
pkg.addFile('scripts', test, contents); | |
}); | |
Object.keys(development).forEach(function (dependency) { | |
pkg.dependencies[dependency] = development[dependency]; | |
}); | |
return next(); | |
}); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment