From 0a325ad503de115158a31306f69d65cf0a06b167 Mon Sep 17 00:00:00 2001 From: Stas Vilchik Date: Wed, 30 Sep 2015 15:45:27 +0200 Subject: [PATCH] add coverage reporting for web tests --- server/sonar-web/.istanbul.yml | 5 +++++ server/sonar-web/package.json | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 server/sonar-web/.istanbul.yml diff --git a/server/sonar-web/.istanbul.yml b/server/sonar-web/.istanbul.yml new file mode 100644 index 00000000000..3bb29874399 --- /dev/null +++ b/server/sonar-web/.istanbul.yml @@ -0,0 +1,5 @@ +instrumentation: + root: 'src/main/js' + extensions: + - .js + - .jsx diff --git a/server/sonar-web/package.json b/server/sonar-web/package.json index 0aede03a2f9..c6de70b2cfe 100644 --- a/server/sonar-web/package.json +++ b/server/sonar-web/package.json @@ -23,6 +23,7 @@ "grunt-rename": "^0.1.4", "grunt-text-replace": "0.4.0", "intern": "3.0.0", + "isparta": "^3.0.4", "jit-grunt": "0.9.1", "jquery": "2.1.4", "jsdom": "^6.5.1", @@ -36,6 +37,7 @@ "scripts": { "build-fast": "./node_modules/.bin/grunt build-fast", "build": "./node_modules/.bin/grunt build", - "test": "./node_modules/.bin/mocha --opts tests/mocha.opts tests" + "test": "./node_modules/.bin/mocha --opts tests/mocha.opts tests", + "coverage": "./node_modules/.bin/babel-node ./node_modules/.bin/isparta cover --dir './target/coverage' --include '**/*.js' --include '**/*.jsx' ./node_modules/.bin/_mocha -- --opts tests/mocha.opts tests" } } -- 2.39.5