Commit dd43a0db authored by Robert Knight's avatar Robert Knight

Update dependencies for compatibility with Babel 7

Upgrade the dependencies used for adding dependency injection
annotations to Angular components and services, and the libs used for
code coverage reporting.

- Replace browserify-ngannotate with babel-plugin-angularjs-annotate.
  The repo's README states that the former is unmaintained and the
  latter is the successor.

- Replace browserify-istanbul + isparta + karma-coverage for code
  coverage reporting with babel-plugin-istanbul +
  karma-coverage-istanbul-reporter.

  babel-plugin-istanbul is the recommended method for instrumenting code
  using current versions of Istanbul. The karma-coverage reporter uses
  an old version of Istanbul. karma-coverage-istanbul-reporter is
  a reporter that uses the current version and is intended to be used
  alongside the Babel plugin.

- Upgrade karma and karma-browserify
parent cb50903e
......@@ -6,5 +6,6 @@
}
}]
],
"plugins": ["angularjs-annotate"],
"ignore": ["**/vendor/*"]
}
......@@ -19,11 +19,11 @@
"autofill-event": "0.0.1",
"autoprefixer": "^9.4.7",
"aws-sdk": "^2.345.0",
"babel-plugin-angularjs-annotate": "^0.9.0",
"babel-plugin-istanbul": "^5.1.0",
"babel-preset-env": "^1.7.0",
"babelify": "^10.0.0",
"browserify": "^16.2.3",
"browserify-istanbul": "^2.0.0",
"browserify-ngannotate": "^2.0.0",
"browserify-shim": "^3.8.12",
"browserify-versionify": "^1.0.6",
"chai": "^4.1.2",
......@@ -64,14 +64,12 @@
"gulp-sourcemaps": "^2.6.4",
"gulp-util": "^3.0.7",
"hammerjs": "^2.0.4",
"isparta": "^4.0.0",
"istanbul": "^0.4.5",
"jquery": "^3.2.1",
"js-polyfills": "^0.1.16",
"karma": "^4.0.0",
"karma-browserify": "^6.0.0",
"karma-chai": "^0.1.0",
"karma-coverage": "^1.1.1",
"karma-coverage-istanbul-reporter": "^2.0.4",
"karma-mocha": "^1.1.1",
"karma-mocha-reporter": "^2.0.4",
"karma-phantomjs-launcher": "^1.0.1",
......@@ -113,7 +111,6 @@
},
"browserify": {
"transform": [
"browserify-ngannotate",
"browserify-shim",
"browserify-versionify",
[
......
'use strict';
const istanbul = require('browserify-istanbul');
/* global __dirname */
const path = require('path');
module.exports = function(config) {
config.set({
......@@ -63,23 +65,12 @@ module.exports = function(config) {
transform: [
'coffeeify',
istanbul({
ignore: [
// Third party code
'**/node_modules/**', '**/vendor/*',
// Non JS modules
'**/*.html', '**/*.svg',
],
// There is an outstanding bug with karma-coverage and istanbul
// in regards to doing source mapping and transpiling CoffeeScript.
// The least bad work around is to replace the instrumenter with
// isparta and it will handle doing the re mapping for us.
// This issue follows the issue and attempts to fix it:
// https://github.com/karma-runner/karma-coverage/issues/157
instrumenter: require('isparta'),
}),
'babelify',
['babelify', {
// The transpiled CoffeeScript is fed through Babelify to add
// code coverage instrumentation for Istanbul.
extensions: ['.js', '.coffee'],
plugins: ['babel-plugin-istanbul'],
}],
],
},
......@@ -91,17 +82,17 @@ module.exports = function(config) {
output: 'minimal',
},
coverageReporter: {
dir: '../coverage/',
reporters: [
{type:'html'},
{type:'json', subdir: './'},
],
coverageIstanbulReporter: {
dir: path.join(__dirname, '../coverage'),
reports: ['json', 'html'],
'report-config': {
json: { subdir: './' },
},
},
// Use https://www.npmjs.com/package/karma-mocha-reporter
// for more helpful rendering of test failures
reporters: ['mocha', 'coverage'],
reporters: ['mocha', 'coverage-istanbul'],
// web server port
port: 9876,
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment