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iBACD,IAAI,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;YAExB,SAAS,MAAM,CAAC,KAAW;gBACzB,eAAM,CAAC,MAAM,GAAG,IAAI,CAAC;gBACrB,IAAI,CAAC,KAAK,CAAC,CAAC;YACd,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC,CAAC","sourcesContent":["import { global } from '@theintern/common';\n\nimport Node from '../lib/executors/Node';\nimport { Config } from '../lib/common/config';\nimport { getConfig } from '../lib/node/util';\n\nexport = function(grunt: IGrunt) {\n grunt.registerMultiTask('intern', function() {\n const done = this.async();\n const options = this.options<TaskOptions>({});\n\n // Force colored output for istanbul report\n process.env.FORCE_COLOR = 'true';\n\n getConfigAndOptions(options)\n .then(({ config, options }) => {\n const intern = (global.intern = new Node());\n intern.configure(config);\n intern.configure(options);\n\n return intern.run();\n })\n .then(finish, finish);\n\n function finish(error?: any) {\n global.intern = null;\n done(error);\n }\n });\n};\n\ninterface TaskOptions extends grunt.task.ITaskOptions, Partial<Config> {\n [key: string]: any;\n}\n\nfunction getConfigAndOptions(\n options: TaskOptions\n): Promise<{\n config: Partial<Config>;\n options: TaskOptions;\n}> {\n if (options.config) {\n return getConfig(options.config, []).then(({ config }) => {\n const opts = { ...options };\n delete opts.config;\n return { config, options: opts };\n });\n }\n\n return Promise.resolve({ config: {}, options });\n}\n"]}
\No newline at end of file