mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-20 04:14:21 +08:00
chore(build): add tslint and unit tests to prerelease gulp task
closes #5755
This commit is contained in:
36
gulpfile.js
36
gulpfile.js
@ -689,9 +689,16 @@ function buildDemoSass(isProductionMode) {
|
|||||||
require('./scripts/snapshot/snapshot.task')(gulp, argv, buildConfig);
|
require('./scripts/snapshot/snapshot.task')(gulp, argv, buildConfig);
|
||||||
|
|
||||||
// requires bundle.system to be run once
|
// requires bundle.system to be run once
|
||||||
gulp.task('karma', ['tests'], function() {
|
gulp.task('karma', ['tests'], function(done) {
|
||||||
var karma = require('karma').server;
|
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() {
|
gulp.task('karma-watch', ['watch.tests', 'bundle.system'], function() {
|
||||||
@ -710,8 +717,15 @@ gulp.task('karma-watch', ['watch.tests', 'bundle.system'], function() {
|
|||||||
* some prerelease magic (see 'prepare') and copies npm package and tooling
|
* some prerelease magic (see 'prepare') and copies npm package and tooling
|
||||||
* files to dist.
|
* files to dist.
|
||||||
*/
|
*/
|
||||||
gulp.task('prerelease', ['prepare', 'build.release'], function(done){
|
gulp.task('prerelease', function(done){
|
||||||
runSequence('package', done);
|
runSequence(
|
||||||
|
'tslint',
|
||||||
|
'prepare',
|
||||||
|
'build.release',
|
||||||
|
'karma',
|
||||||
|
'package',
|
||||||
|
done
|
||||||
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -931,11 +945,11 @@ gulp.task('tooling', function(){
|
|||||||
/**
|
/**
|
||||||
* TS LINT
|
* TS LINT
|
||||||
*/
|
*/
|
||||||
gulp.task("tslint", function() {
|
gulp.task('tslint', function(done) {
|
||||||
var tslint = require("gulp-tslint");
|
var tslint = require('gulp-tslint');
|
||||||
gulp.src([
|
return gulp.src([
|
||||||
'ionic/**/*.ts',
|
'ionic/**/*.ts',
|
||||||
'!ionic/**/test/**/*',
|
'!ionic/**/test/**/*',
|
||||||
]).pipe(tslint())
|
]).pipe(tslint())
|
||||||
.pipe(tslint.report('verbose'));
|
.pipe(tslint.report('verbose'));
|
||||||
});
|
});
|
||||||
|
@ -84,7 +84,7 @@ export class Img {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private _loaded(isLoaded: boolean) {
|
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) {
|
enable(shouldEnable: boolean) {
|
||||||
|
@ -190,7 +190,7 @@ export class Platform {
|
|||||||
triggerReady() {
|
triggerReady() {
|
||||||
this._zone.run(() => {
|
this._zone.run(() => {
|
||||||
this._readyResolve();
|
this._readyResolve();
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -741,5 +741,5 @@ export interface PlatformVersion {
|
|||||||
str?: string;
|
str?: string;
|
||||||
num?: number;
|
num?: number;
|
||||||
major?: number;
|
major?: number;
|
||||||
minor?: number
|
minor?: number;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user