Skip to content

Commit b23b0e2

Browse files
Speeds up mocha tests for development
1 parent dd21108 commit b23b0e2

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

gulpfile.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ gulp.task('build:static', ['build:clean'], () =>
7676
.pipe(gulp.dest(BUILD_SRC_DIR))
7777
);
7878

79-
gulp.task('build:typescript', ['build:clean', 'build:static'], () =>
79+
gulp.task('build:typescript', ['build:clean', 'build:static', 'typescript:format', 'typescript:lint'], () =>
8080
gulp.src(TYPESCRIPT_FILES.concat(['typings/tsd.d.ts']))
8181
.pipe($.changed(BUILD_SRC_DIR, { extension: '.js' }))
8282
.pipe($.sourcemaps.init())
@@ -92,22 +92,22 @@ gulp.task('test:remap-istanbul', ['test:mocha'], () =>
9292
.pipe($.exec(`./node_modules/.bin/remap-istanbul -i coverage/coverage.json -o coverage/html-report -t html`))
9393
);
9494

95-
gulp.task('test:mocha', ['build:typescript'], () =>
95+
gulp.task('test:mocha', DEVELOPMENT ? [] : ['build:typescript'], () =>
9696
gulp.src([`${BUILD_SRC_DIR}/tests/*-helper.js`, `${BUILD_SRC_DIR}/**/*-spec.js`])
9797
.pipe($.mocha({
9898
recursive: true,
99-
reporter: 'min',
99+
reporter: 'spec',
100100
ui: 'bdd',
101-
istanbul: true,
101+
istanbul: !DEVELOPMENT,
102102
}))
103103
);
104104

105105
gulp.task('test', ['test:mocha', 'test:remap-istanbul']);
106106

107-
gulp.task('dev', ['typescript:format', 'build:typescript', 'dev:server'], () => {
108-
gulp.watch(TYPESCRIPT_FILES, ['build:typescript', 'typescript:format', 'typescript:lint']);
107+
gulp.task('dev', ['build:typescript', 'dev:server'], () => {
108+
gulp.watch(TYPESCRIPT_FILES, ['build:typescript']);
109109
gulp.watch(STATIC_FILES, ['build:static']);
110-
gulp.watch(BUILD_SRC_FILES, ['test']);
110+
gulp.watch(BUILD_SRC_FILES, ['test:mocha']);
111111
gulp.watch(['webpack/**/*'], ['dev:server']);
112112
});
113113

webpack/dev-server.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
const webpack = require('webpack');
22
const express = require('express');
3+
const yargs = require('yargs').argv;
34
const webpackDevMiddleware = require('webpack-dev-middleware');
45
const webpackHotMiddleware = require('webpack-hot-middleware');
56

@@ -12,7 +13,7 @@ const compiler = webpack(config);
1213

1314
app.use(webpackDevMiddleware(compiler, {
1415
stats,
15-
noInfo: false,
16+
noInfo: !yargs.verbose,
1617
publicPath: WEBPACK_PUBLIC_PATH,
1718
}));
1819

0 commit comments

Comments
 (0)