ONOS-6524: Added Code Coverage tools to gulp

When `gulp test` is executed, Karma will now generate an interactive html report for code coverage in each file. The folder can be found in web/gui/src/main/webapp/tests/coverage

Change-Id: I951ac1bea7f3f0ca35deb9cc823bb883bcd9f8a5
diff --git a/tools/gui/gulp-tasks/bundles/unit-tests/index.js b/tools/gui/gulp-tasks/bundles/unit-tests/index.js
new file mode 100644
index 0000000..2d0b903
--- /dev/null
+++ b/tools/gui/gulp-tasks/bundles/unit-tests/index.js
@@ -0,0 +1,20 @@
+import gulp from 'gulp';
+import istanbul from 'gulp-istanbul';
+import path from 'path';
+import { Server } from 'karma';
+
+const tests = ['../../web/gui/src/main/webapp/tests/**/*.js'];
+
+const test = () => {
+    new Server({
+        configFile: path.join(__dirname, '../../../../../', '/web/gui/src/main/webapp/tests/karma.conf.js'),
+        singleRun: true
+    }, () => { console.log('done') }).start();
+};
+
+const tasks = () => {
+    gulp.task('pre-test', () => preTest());
+    gulp.task('test', () => test());
+};
+
+export default tasks();
\ No newline at end of file
diff --git a/tools/gui/gulp-tasks/index.js b/tools/gui/gulp-tasks/index.js
index 3bef084..5ac5c83 100644
--- a/tools/gui/gulp-tasks/index.js
+++ b/tools/gui/gulp-tasks/index.js
@@ -1,2 +1,3 @@
 export { default as BundleJS } from './bundles/bundle-js';
-export { default as BundleCSS } from './bundles/bundle-css';
\ No newline at end of file
+export { default as BundleCSS } from './bundles/bundle-css';
+export { default as UnitTests } from './bundles/unit-tests';
\ No newline at end of file