aboutsummaryrefslogtreecommitdiff
path: root/tools/tasks/build.test.ts
blob: 3e089cd1aaee28a9ce95ad9b83f4006bdee059a5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import {join} from 'path';
import {APP_SRC, TEST_DEST} from '../config';
import {tsProjectFn} from '../utils';

export = function buildTest(gulp, plugins) {
  return function () {
    let tsProject = tsProjectFn(plugins);
    let src = [
                join(APP_SRC, '**/*.ts'),
                '!' + join(APP_SRC, 'bootstrap.ts')
              ];

    let result = gulp.src(src)
      .pipe(plugins.plumber())
      .pipe(plugins.inlineNg2Template({ base: APP_SRC }))
      .pipe(plugins.typescript(tsProject));

    return result.js
      .pipe(gulp.dest(TEST_DEST));
  };
};