You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ode.apache.org by sa...@apache.org on 2016/09/24 04:54:23 UTC
[2/6] ode-console git commit: Used Karma as gulp-karma is deprecated.
Removed revisioning, revisit later.
Used Karma as gulp-karma is deprecated. Removed revisioning, revisit later.
Project: http://git-wip-us.apache.org/repos/asf/ode-console/repo
Commit: http://git-wip-us.apache.org/repos/asf/ode-console/commit/dd1fcbae
Tree: http://git-wip-us.apache.org/repos/asf/ode-console/tree/dd1fcbae
Diff: http://git-wip-us.apache.org/repos/asf/ode-console/diff/dd1fcbae
Branch: refs/heads/master
Commit: dd1fcbae3d56f6a67a81e02a93a2ac31fb8a012c
Parents: 6eb1398
Author: sathwik <sa...@apache.org>
Authored: Tue Aug 30 14:15:11 2016 +0530
Committer: sathwik <sa...@apache.org>
Committed: Tue Aug 30 14:15:11 2016 +0530
----------------------------------------------------------------------
gulp/build.js | 2 +-
gulp/unit-tests.js | 28 ++++++++++++++++++----------
karma.conf.js | 2 +-
src/index.html | 3 ++-
4 files changed, 22 insertions(+), 13 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ode-console/blob/dd1fcbae/gulp/build.js
----------------------------------------------------------------------
diff --git a/gulp/build.js b/gulp/build.js
index 46d438c..e257770 100644
--- a/gulp/build.js
+++ b/gulp/build.js
@@ -92,7 +92,7 @@ gulp.task('html', ['wiredep', 'injector:css', 'injector:js', 'partials'], functi
addRootSlash: false
}))
.pipe($.useref())
- .pipe($.rev())
+ //.pipe($.rev())
.pipe(jsFilter)
.pipe($.ngAnnotate())
.pipe($.uglify({preserveComments: $.uglifySaveLicense}))
http://git-wip-us.apache.org/repos/asf/ode-console/blob/dd1fcbae/gulp/unit-tests.js
----------------------------------------------------------------------
diff --git a/gulp/unit-tests.js b/gulp/unit-tests.js
index 05ff6a0..719aad4 100644
--- a/gulp/unit-tests.js
+++ b/gulp/unit-tests.js
@@ -5,6 +5,22 @@ var gulp = require('gulp');
var $ = require('gulp-load-plugins')();
var wiredep = require('wiredep');
+var karma = require('karma');
+
+function runTests(configuration) {
+ var Server = karma.Server;
+
+ var server = new Server(configuration, function(exitCode) {
+ console.log('Karma has exited with ' + exitCode)
+ process.exit(exitCode)
+ });
+
+ server.on('browser_register', function (browser) {
+ console.log('A new browser was registered')
+ });
+
+ return server.start();
+}
gulp.task('test', function() {
var bowerDeps = wiredep({
@@ -15,16 +31,8 @@ gulp.task('test', function() {
});
var testFiles = bowerDeps.js.concat([
- 'src/{app,components}/**/*.js'
+ 'src/app/**/*.js','src/components/**/*.js'
]);
- return gulp.src(testFiles)
- .pipe($.karma({
- configFile: 'karma.conf.js',
- action: 'run'
- }))
- .on('error', function(err) {
- // Make sure failed tests cause gulp to exit non-zero
- throw err;
- });
+ return runTests({configFile: __dirname + '/../karma.conf.js', files: testFiles})
});
http://git-wip-us.apache.org/repos/asf/ode-console/blob/dd1fcbae/karma.conf.js
----------------------------------------------------------------------
diff --git a/karma.conf.js b/karma.conf.js
index 12e3ff3..a5beaa4 100644
--- a/karma.conf.js
+++ b/karma.conf.js
@@ -4,7 +4,7 @@ module.exports = function(config) {
config.set({
autoWatch : false,
-
+ singleRun : true,
frameworks: ['jasmine'],
browsers : ['PhantomJS'],
http://git-wip-us.apache.org/repos/asf/ode-console/blob/dd1fcbae/src/index.html
----------------------------------------------------------------------
diff --git a/src/index.html b/src/index.html
index 08c36bc..1ca17e9 100644
--- a/src/index.html
+++ b/src/index.html
@@ -34,6 +34,7 @@
<div ng-view></div>
+
<!-- build:js scripts/vendor.js -->
<!-- bower:js -->
<script src="../bower_components/modernizr/modernizr.js"></script>
@@ -66,8 +67,8 @@
<script src="app/st-select.directive.js"></script>
<script src="vendor/jquery.xpath.js"></script>
<script src="vendor/vkbeautify.js"></script>
- <script src="components/navbar/navbar.controller.js"></script>
<script src="app/dashboard/dashboard.controller.js"></script>
+ <script src="components/navbar/navbar.controller.js"></script>
<script src="app/instance/instance.controller.js"></script>
<script src="app/instance/instance.service.js"></script>
<script src="app/instance/instanceactions.controller.js"></script>