UNPKG

karma-yuitest-framework

Version:

A YUITest runner for the karma framework, see the tests for examples of how the tests should look. Note: I don't recommend writing new YUITest tests

18 lines (15 loc) 566 B
module.exports = function (grunt) { /** * Build given file - wrap it with a function call */ grunt.registerMultiTask('build', 'Wrap given file into a function call.', function () { var src = grunt.file.expand(this.data).pop() var dest = src.replace('src/', 'lib/') var wrapper = src.replace('.js', '.wrapper') grunt.file.copy(wrapper, dest, {process: function (content) { var wrappers = content.split(/%CONTENT%\r?\n/) return wrappers[0] + grunt.file.read(src) + wrappers[1] }}) grunt.log.ok('Created ' + dest) }) }