New watcher for tests, added some missing items to README and
package.json
This commit is contained in:
12
README.md
12
README.md
@@ -26,12 +26,18 @@ In case of errors during ```npm install```, remove node_modules dir and clean np
|
||||
|
||||
Single test run:
|
||||
|
||||
- ```karma start --single-run```
|
||||
-- ```npm test``` (alternatively run ```karma start --single-run```)
|
||||
-- ```npm run lint``` to run ESLint
|
||||
-- ```npm test && npm run lint``` to run Tests and ESLint
|
||||
|
||||
(Info on Linting setup here: https://medium.com/@dan_abramov/lint-like-it-s-2015-6987d44c5b48)
|
||||
|
||||
During development:
|
||||
|
||||
- ```karma start``` to start the server
|
||||
- ```karma run``` to run the tests (new terminal window)
|
||||
-- ```karma start``` to start the server
|
||||
-- ```karma run``` to run the tests (new terminal window)
|
||||
|
||||
|
||||
|
||||
|
||||
## Make Undercloud API Services available when running app from laptop
|
||||
|
||||
21
gulpfile.js
21
gulpfile.js
@@ -1,7 +1,6 @@
|
||||
var gulp = require('gulp');
|
||||
|
||||
var browserSync = require('browser-sync');
|
||||
var less = require('gulp-less');
|
||||
var browserSync = require('browser-sync'); var less = require('gulp-less');
|
||||
// var rename = require('gulp-rename');
|
||||
var shell = require('gulp-shell');
|
||||
// var uglify = require('gulp-uglify');
|
||||
@@ -22,7 +21,10 @@ gulp.task('serve', ['webpack-app', 'less'], function(){
|
||||
});
|
||||
|
||||
gulp.watch('src/less/**/*.less', ['less']);
|
||||
gulp.watch('src/js/**/*.js', ['webpack-app']);
|
||||
// Re-build app and run tests on app change.
|
||||
gulp.watch('src/js/**/*.js', ['webpack-app', 'test-run']);
|
||||
// Run tests on test change.
|
||||
gulp.watch('src/__tests__/**/*.js', ['test-run']);
|
||||
gulp.watch('src/*.html').on('change', browserSync.reload);
|
||||
});
|
||||
|
||||
@@ -33,10 +35,13 @@ gulp.task('less', function () {
|
||||
.pipe(browserSync.stream());
|
||||
});
|
||||
|
||||
gulp.task('test', shell.task('karma start --single-run', {
|
||||
// Task doesn't error when tests fail
|
||||
}));
|
||||
// Start test server, run tests once, then quit.
|
||||
gulp.task('test', shell.task('karma start --single-run'));
|
||||
|
||||
// Start test server, run tests, keep server running..
|
||||
gulp.task('test-start', shell.task('karma start'));
|
||||
|
||||
gulp.task('default', [ 'serve' ], function() {
|
||||
});
|
||||
// Do a single test run (expects Karma server to be running).
|
||||
gulp.task('test-run', shell.task('karma run'));
|
||||
|
||||
gulp.task('default', [ 'serve', 'test-start' ], function() {});
|
||||
|
||||
@@ -41,7 +41,10 @@
|
||||
"karma-sourcemap-loader": "~0.3.5",
|
||||
"karma-cli": "~0.1.0"
|
||||
},
|
||||
"scripts": {},
|
||||
"scripts": {
|
||||
"test": "karma start --single-run",
|
||||
"lint": "eslint src/js"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/jtomasek/tripleo_ui"
|
||||
|
||||
Reference in New Issue
Block a user