Update karma, jasmine and istanbul

istanbul has been replaced by the nyc runner. Update karma
to latest.

Change-Id: Id1355d1116a7071403be3a77447a51ef2ebb7a77
This commit is contained in:
Monty Taylor
2020-05-25 10:58:16 -05:00
parent 53dd82c9f9
commit 2498b473b9
7 changed files with 35 additions and 25 deletions

View File

@@ -2,5 +2,10 @@
"presets": [
"@babel/preset-env"
],
"plugins": ["@babel/plugin-transform-runtime"]
"plugins": ["@babel/plugin-transform-runtime"],
"env": {
"test": {
"plugins": [ "istanbul" ]
}
}
}

View File

@@ -33,7 +33,7 @@ export default (config) => {
// test results reporter to use
// possible values: 'dots', 'progress'
// available reporters: https://npmjs.org/browse/keyword/karma-reporter
reporters: ['progress', 'coverage', 'threshold'],
reporters: ['progress', 'coverage'],
// web server port
port: 9876,
@@ -73,13 +73,5 @@ export default (config) => {
dir: '../../cover/' + testDir + '/browser/' //path to created html doc
},
// The current coverage threshold values. These should never drop.
thresholdReporter: {
statements: 88,
branches: 64,
functions: 77,
lines: 75
}
});
};

View File

@@ -1,2 +1,2 @@
require('babel-register');
require('@babel/register');
module.exports = require('./karma.conf.babel').default;

View File

@@ -6,11 +6,11 @@
"scripts": {
"configure-devstack": "babel-node ./configure-devstack.js",
"test": "npm run test:node; npm run test:browser",
"test:node": "istanbul cover jasmine JASMINE_CONFIG_PATH=test/unit/jasmine.json",
"test:node": "nyc babel-node test/unit/run.js",
"test:browser": "karma start",
"posttest:node": "istanbul check-coverage",
"posttest:node": "nyc check-coverage",
"functional-test": "npm run functional-test:node ; npm run functional-test:browser",
"functional-test:node": "istanbul cover --dir cover/functional/node jasmine JASMINE_CONFIG_PATH=test/functional/jasmine.json",
"functional-test:node": "nyc --dir cover/functional/node babel-node test/functional/run.js",
"functional-test:browser": "karma start --basePath test/functional/",
"lint": "eslint ./",
"build": "babel src -d dist && webpack",
@@ -42,24 +42,24 @@
"@babel/register": "^7.0.0",
"babel-core": "^7.0.0-bridge.0",
"babel-loader": "^8.1.0",
"babel-plugin-istanbul": "^6.0.0",
"babel-plugin-transform-inline-environment-variables": "^6.8.0",
"eslint": "^3.0.0",
"eslint-config-openstack": "4.0.1",
"fetch-mock": "^5.0.5",
"istanbul": "^1.0.0-alpha.2",
"jasmine": "^2.4.1",
"jasmine-core": "^2.4.1",
"jasmine": "^3.5.0",
"js-yaml": "^3.6.1",
"jsdoc": "^3.4.0",
"jsdoc-sphinx": "0.0.6",
"json-loader": "^0.5.4",
"karma": "^1.1.1",
"karma-chrome-launcher": "^1.0.1",
"karma-coverage": "^1.1.0",
"karma-firefox-launcher": "^1.0.0",
"karma-jasmine": "^1.0.2",
"karma-threshold-reporter": "^0.1.15",
"karma-webpack": "^1.7.0",
"karma": "^5.0.9",
"karma-chrome-launcher": "^3.1.0",
"karma-cli": "^2.0.0",
"karma-coverage": "^2.0.2",
"karma-firefox-launcher": "^1.3.0",
"karma-jasmine": "^3.1.1",
"karma-webpack": "^4.0.2",
"nyc": "^15.0.1",
"webpack": "^4.43.0",
"webpack-cli": "^3.3.11",
"yaml-loader": "^0.4.0"

5
test/functional/run.js Normal file
View File

@@ -0,0 +1,5 @@
import Jasmine from 'jasmine';
const jasmine = new Jasmine();
jasmine.loadConfigFile('test/functional/jasmine.json');
jasmine.execute();

5
test/unit/run.js Normal file
View File

@@ -0,0 +1,5 @@
import Jasmine from 'jasmine';
const jasmine = new Jasmine();
jasmine.loadConfigFile('test/unit/jasmine.json');
jasmine.execute();

View File

@@ -28,5 +28,8 @@ export default {
plugins: [
new webpack.NormalModuleReplacementPlugin(/helpers\/cloudsConfig/,
'json!yaml!' + cloudsYamlPath)
]
],
node: {
fs: "empty"
}
};