Stryker

typescript-rest.ts - Stryker report

File / Directory
Mutation score
# Killed
# Survived
# Timeout
# No coverage
# Runtime errors
# Transpile errors
Total detected
Total undetected
Total mutants
typescript-rest.ts
100.00 %
100.00 0 0 0 0 30 0 0 0 30
Expand all
'use strict';

import * as fs from 'fs-extra';
import * as path from 'path';

import { Server } from './server';
import * as Errors from './server-errors';
import * as Return from './server-return';

export * from 0'./decorators';
export * from 1'./server-types';
export * from 2'./server';
export * from 3'./passport-authenticator';

export { Return };
export { Errors };

const CONFIG_FILE = searchConfigFile();
if (45CONFIG_FILE 6&& fs.existsSync(CONFIG_FILE)) 7{
    const config = fs.readJSONSync(CONFIG_FILE);
    if (89config.useIoC) 10{
        Server.useIoC();
    } else if (1112config.serviceFactory) 13{
        if (1415config.serviceFactory.indexOf(16'.') 17=== 0) 18{
            config.serviceFactory = path.join(process.cwd(), config.serviceFactory);
        }
        const serviceFactory = require(config.serviceFactory);
        Server.registerServiceFactory(serviceFactory);
    }
}

function searchConfigFile() 19{
    let configFile = path.join(__dirname, 20'rest.config');
    while (2122!fs.existsSync(configFile)) 23{
        const fileOnParent = path.normalize(path.join(path.dirname(configFile), 24'..', 25'rest.config'));
        if (2627configFile 28=== fileOnParent) 29{
            return null;
        }
        configFile = fileOnParent;
    }
    return configFile;
}
# Mutator State Location Original Replacement
0 StringLiteral RuntimeError 9 : 14 './ ' ""
1 StringLiteral RuntimeError 10 : 14 './ ... ' ""
2 StringLiteral RuntimeError 11 : 14 './ ' ""
3 StringLiteral RuntimeError 12 : 14 './ ... ' ""
4 IfStatement RuntimeError 18 : 4 && ... )
5 IfStatement RuntimeError 18 : 4 && ... )
6 BinaryExpression RuntimeError 18 : 16 && ||
7 Block RuntimeError 18 : 47 { ... } } {}
8 IfStatement RuntimeError 20 : 8 .
9 IfStatement RuntimeError 20 : 8 .
10 Block RuntimeError 20 : 23 { ... } {}
11 IfStatement RuntimeError 22 : 15 .
12 IfStatement RuntimeError 22 : 15 .
13 Block RuntimeError 22 : 38 { ... } {}
14 IfStatement RuntimeError 23 : 12 . ...) ===
15 IfStatement RuntimeError 23 : 12 . ...) ===
16 StringLiteral RuntimeError 23 : 42 '.' ""
17 BinaryExpression RuntimeError 23 : 47 === !==
18 Block RuntimeError 23 : 54 { ... } {}
19 Block RuntimeError 31 : 28 { ... ; } {}
20 StringLiteral RuntimeError 32 : 42 ' . ' ""
21 WhileStatement RuntimeError 33 : 11 ! . ... )
22 PrefixUnaryExpression RuntimeError 33 : 11 ! . ... ) . ... )
23 Block RuntimeError 33 : 39 { ... } {}
24 StringLiteral RuntimeError 34 : 80 '..' ""
25 StringLiteral RuntimeError 34 : 86 ' . ' ""
26 IfStatement RuntimeError 35 : 12 ===
27 IfStatement RuntimeError 35 : 12 ===
28 BinaryExpression RuntimeError 35 : 23 === !==
29 Block RuntimeError 35 : 41 { ... } {}