Passed
Push — master ( fcc34c...0fe71a )
by Vitaly
03:32 queued 01:46
created

gulp/test.js   A

Complexity

Total Complexity 6
Complexity/F 1

Size

Lines of Code 55
Function Count 6

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 0
nc 1
dl 0
loc 55
rs 10
c 1
b 0
f 0
wmc 6
mnd 0
bc 6
fnc 6
bpm 1
cpm 1
noi 1

3 Functions

Rating   Name   Duplication   Size   Complexity  
B gulp.task(ꞌtest:scriptꞌ) 0 24 1
A test.js ➔ ??? 0 7 1
A gulp.task(ꞌtest:tddꞌ) 0 5 1
1
var gulp = require('gulp');
2
var Server = require('karma').Server;
3
var rollup = require('rollup').rollup;
4
var typescript = require('rollup-plugin-typescript');
5
var multiEntry = require('rollup-plugin-multi-entry');
6
var PluginError = require('gulp-util').PluginError;
7
var ts = require('gulp-typescript');
8
var tsProject = ts.createProject('tsconfigTypeChecking.json', {noExternalResolve : true});
9
10
gulp.task('test:tdd', function (done) {
11
    new Server({
12
        configFile: require('path').resolve('karma.conf.js')
13
    }, done).start();
14
});
15
16
var rollupBundle = null;
17
18
const globals = {
19
    '@angular/core': 'ng.core',
20
    '@angular/platform-browser-dynamic': 'ng.platformBrowserDynamic'
21
};
22
23
gulp.task('test:script', function () {
24
    return rollup({
25
        entry: 'test/**/*.ts',
26
        external: Object.keys(globals),
27
        cache: rollupBundle,
28
        plugins: [
29
            multiEntry({exports: false}),
30
            // tslint({ throwError: true, include: 'src/**' }),
31
            typescript()
32
        ],
33
        onwarn: function (msg) {
34
            throw Error(msg);
35
        }
36
    }).then(function (bundle) {
37
        return bundle.write({
38
            globals,
39
            format: 'iife',
40
            dest: 'test/tmp/test.js',
41
            sourceMap: 'inline'
42
        });
43
    }).catch(function (err) {
44
        throw new PluginError('rollup', err.toString());
45
    });
46
});
47
48
49
gulp.task('test:typechecking', (done) => {
0 ignored issues
show
Unused Code introduced by
The parameter done is not used and could be removed.

This check looks for parameters in functions that are not used in the function body and are not followed by other parameters which are used inside the function.

Loading history...
50
    return gulp.src([
51
        'test/**/*.ts',
52
        "includes/**/*.ts"
53
    ])
54
        .pipe(ts(tsProject));
55
});