All files / tasks run.ts

100% Statements 8/8
100% Branches 2/2
100% Functions 2/2
100% Lines 8/8
1 2 3 4 5 6 7 8 9 10 11 12 13 14 1542x     42x 42x 2x   2x 2x   2x 2x      
import loadDojoLoader from '../lib/load-dojo-loader';
import ITask = grunt.task.ITask;
 
export = function(grunt: IGrunt, packageJson: any) {
	grunt.registerTask('run', 'Bootstrap dojo-loader and run the given --main', function (this: ITask) {
		this.async(); // Ensure Grunt doesn't exit the process.
 
		const main = <string> grunt.option('main') || 'src/main';
		grunt.log.ok(main);
 
		const { require } = loadDojoLoader(packageJson);
		require([main]);
	});
};