Skip to content
Permalink
Browse files

Switch test coverage to use Istanbul

closes #4644

- Switch from using blanket to istanbul
- Rename some test files for consistency (and so that they will run)
  • Loading branch information...
ErisDS committed Apr 18, 2015
1 parent ede50f3 commit ca1c8cf747002480dc92eb017b887a61e78743bc
@@ -54,8 +54,9 @@ Session.vim
# Changelog, which is autogenerated, not committed
CHANGELOG.md

# Casper generated files
# Test generated files
/core/test/functional/*.png
/core/test/coverage

config.js
/core/client/config.js
@@ -252,6 +252,23 @@ var _ = require('lodash'),
}
},

// ### grunt-mocha-istanbul
// Configuration for the mocha test coverage generator
// `grunt coverage`.
mocha_istanbul: {
coverage: {
// TODO fix the timing/async & cleanup issues with the route and integration tests so that
// they can also have coverage generated for them & the order doesn't matter
src: ['core/test/integration', 'core/test/unit'],
options: {
mask: '**/*_spec.js',
coverageFolder: 'core/test/coverage',
mochaOptions: ['--timeout=15000'],
excludes: ['core/client/**']
}
}
},

// ### grunt-bg-shell
// Used to run ember-cli watch in the background
bgShell: {
@@ -312,13 +329,6 @@ var _ = require('lodash'),
}
},

// #### Generate coverage report
// See the `grunt test-coverage` task in the section on [Testing](#testing) for more information.
coverage: {
command: 'node ' + mochaPath + ' --timeout 15000 --reporter html-cov > coverage.html ' +
path.resolve(cwd + '/core/test/blanket_coverage.js')
},

shrinkwrap: {
command: 'npm shrinkwrap'
}
@@ -333,7 +343,7 @@ var _ = require('lodash'),
options: {
onlyUpdated: true,
exclude: 'node_modules,.git,.tmp,bower_components,content,*built,*test,*doc*,*vendor,' +
'config.js,coverage.html,.travis.yml,*.min.css,screen.css',
'config.js,.travis.yml,*.min.css,screen.css',
extras: ['fileSearch']
}
}
@@ -492,7 +502,7 @@ var _ = require('lodash'),
// * [Building assets](#building%20assets):
// `grunt init`, `grunt` & `grunt prod` or live reload with `grunt dev`
// * [Testing](#testing):
// `grunt validate`, the `grunt test-*` sub-tasks or generate a coverage report with `grunt test-coverage`.
// `grunt validate`, the `grunt test-*` sub-tasks or generate a coverage report with `grunt coverage`.

// ### Help
// Run `grunt help` on the commandline to get a print out of the available tasks and details of
@@ -723,16 +733,17 @@ var _ = require('lodash'),
);

// ### Coverage
// `grunt test-coverage` will generate a report for the Unit and Integration Tests.
// `grunt coverage` will generate a report for the Unit Tests.
//
// This is not currently done as part of CI or any build, but is a tool we have available to keep an eye on how
// well the unit and integration tests are covering the code base.
// Ghost does not have a minimum coverage level - we're more interested in ensuring important and useful areas
// of the codebase are covered, than that the whole codebase is covered to a particular level.
//
// Key areas for coverage are: helpers and theme elements, apps / GDK, the api and model layers.
grunt.registerTask('test-coverage', 'Generate unit and integration (mocha) tests coverage report',
['test-setup', 'shell:coverage']

grunt.registerTask('coverage', 'Generate unit and integration (mocha) tests coverage report',
['test-setup', 'mocha_istanbul:coverage']
);

// #### Master Warning *(Utility Task)*

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -72,7 +72,6 @@
"pg": "4.1.1"
},
"devDependencies": {
"blanket": "~1.1.6",
"bower": "~1.3.10",
"grunt": "~0.4.5",
"grunt-bg-shell": "^2.3.1",
@@ -87,6 +86,7 @@
"grunt-express-server": "~0.4.19",
"grunt-jscs": "~1.2.0",
"grunt-mocha-cli": "~1.11.0",
"grunt-mocha-istanbul": "2.4.0",
"grunt-shell": "~1.1.1",
"grunt-update-submodules": "~0.4.1",
"matchdep": "~0.3.0",

0 comments on commit ca1c8cf

Please sign in to comment.
You can’t perform that action at this time.