Skip to content

Commit

Permalink
Merge pull request #6155 from driftyco/add-lint-karma-to-release
Browse files Browse the repository at this point in the history
chore(build): add tslint and unit tests to prerelease gulp task
  • Loading branch information
adamdbradley committed Apr 14, 2016
2 parents 0bdeab6 + ade9337 commit 4ba9eb0
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 14 deletions.
36 changes: 25 additions & 11 deletions gulpfile.js
Expand Up @@ -689,9 +689,16 @@ function buildDemoSass(isProductionMode) {
require('./scripts/snapshot/snapshot.task')(gulp, argv, buildConfig);

// requires bundle.system to be run once
gulp.task('karma', ['tests'], function() {
gulp.task('karma', ['tests'], function(done) {
var karma = require('karma').server;
return karma.start({ configFile: __dirname + '/scripts/karma/karma.conf.js' })
karma.start({
configFile: __dirname + '/scripts/karma/karma.conf.js'
}, function(result) {
if (result > 0) {
return done(new Error('Karma exited with an error'));
}
done();
});
});

gulp.task('karma-watch', ['watch.tests', 'bundle.system'], function() {
Expand All @@ -710,8 +717,15 @@ gulp.task('karma-watch', ['watch.tests', 'bundle.system'], function() {
* some prerelease magic (see 'prepare') and copies npm package and tooling
* files to dist.
*/
gulp.task('prerelease', ['prepare', 'build.release'], function(done){
runSequence('package', done);
gulp.task('prerelease', function(done){
runSequence(
'tslint',
'prepare',
'build.release',
'karma',
'package',
done
);
});

/**
Expand Down Expand Up @@ -931,11 +945,11 @@ gulp.task('tooling', function(){
/**
* TS LINT
*/
gulp.task("tslint", function() {
var tslint = require("gulp-tslint");
gulp.src([
'ionic/**/*.ts',
'!ionic/**/test/**/*',
]).pipe(tslint())
.pipe(tslint.report('verbose'));
gulp.task('tslint', function(done) {
var tslint = require('gulp-tslint');
return gulp.src([
'ionic/**/*.ts',
'!ionic/**/test/**/*',
]).pipe(tslint())
.pipe(tslint.report('verbose'));
});
2 changes: 1 addition & 1 deletion ionic/components/img/img.ts
Expand Up @@ -84,7 +84,7 @@ export class Img {
}

private _loaded(isLoaded: boolean) {
this._elementRef.nativeElement.classList[isLoaded ? 'add': 'remove']('img-loaded');
this._elementRef.nativeElement.classList[isLoaded ? 'add' : 'remove']('img-loaded');
}

enable(shouldEnable: boolean) {
Expand Down
4 changes: 2 additions & 2 deletions ionic/platform/platform.ts
Expand Up @@ -190,7 +190,7 @@ export class Platform {
triggerReady() {
this._zone.run(() => {
this._readyResolve();
})
});
}

/**
Expand Down Expand Up @@ -741,5 +741,5 @@ export interface PlatformVersion {
str?: string;
num?: number;
major?: number;
minor?: number
minor?: number;
}

0 comments on commit 4ba9eb0

Please sign in to comment.