lib/runs/skip.js

const createReport = require('../createReport.js');

/**
 * @module pete/lib/runs/skip
 */
module.exports = createRunSkip;

/**
 * This run simply generates report without actually calling target function.
 *
 * @alias module:pete/lib/runs/skip
 * @param {Function} fn               to run
 * @param {object}   options
 * @param {object}   state            to pass to the reporting function
 * @return {module:pete/lib/runner~run}
 */
function createRunSkip (fn, options, state) {
	state.runType = module.filename;

	return function runSkip (report) {
		state.mode = 'skip';

		report(null, createReport(options, state));
		report();
	};
}