Skip to content
This repository has been archived by the owner on Dec 13, 2019. It is now read-only.

Update to exclusively use Intern 4 #162

Merged
merged 4 commits into from
Oct 27, 2017
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 6 additions & 15 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,6 @@ exports.initConfig = function (grunt: IGrunt, otherOptions: any) {
require('./tasks/ts')(grunt);
require('./tasks/typedoc')(grunt);

// Copy Intern properties from version-specific object to
// `intern` object
const internVersion = grunt.config('intern.version') || 3;
grunt.config('intern', options[`intern${internVersion}`]);

// Set some Intern-specific options if specified on the command line.
[ 'suites', 'functionalSuites', 'grep' ].forEach(function (option) {
const value = grunt.option<string>(option);
Expand All @@ -121,15 +116,15 @@ exports.initConfig = function (grunt: IGrunt, otherOptions: any) {
}
});

function setCombined(combined: boolean) {
if (combined) {
grunt.config('intern.options.reporters', [
{ id: 'grunt-dojo2/lib/intern/Reporter', file: 'coverage-unmapped.json' }
function setCoverage(coverage: boolean) {
if (coverage) {
grunt.config('intern.options.node.plugins', [
'grunt-dojo2/lib/intern/Reporter'
]);
}
}

setCombined(grunt.option<boolean>('combined'));
setCoverage(grunt.option<boolean>('coverage'));

grunt.registerTask('test', <any> (function (this: ITask) {
const flags = Object.keys(this.flags);
Expand All @@ -139,7 +134,7 @@ exports.initConfig = function (grunt: IGrunt, otherOptions: any) {
}

grunt.option('force', true);
setCombined(internVersion === 3);
setCoverage(true);

grunt.task.run('clean:coverage');
grunt.task.run('dev');
Expand All @@ -148,10 +143,6 @@ exports.initConfig = function (grunt: IGrunt, otherOptions: any) {
grunt.task.run(`intern:${flag}`);
});

if (internVersion === 3) {
grunt.task.run('remapIstanbul:coverage');
}

grunt.task.run('clean:coverage');
}));

Expand Down
15 changes: 15 additions & 0 deletions intern.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"suites": [
"./tests/unit/all.js"
],

"configs": {
"local": {
"coverage": [
"./lib/**/*.js",
"./options/**/*.js",
"./tasks/**/*.js"
]
}
}
}
Loading