All files / tests/unitTests testUtils.js

79.17% Statements 19/24
50% Branches 3/6
50% Functions 1/2
76.19% Lines 16/21

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 494x 4x     4x 5x   5x     5x 2x 2x       5x           5x                     5x 5x 5x                   5x 5x 4x  
import { createRnvConfig, generateBuildConfig } from '../../src/configTools/configParser';
import cli from '../../src/cli';
 
 
export const getConfig = (s) => {
    const argArray = s.split(' ');
 
    const cmd = argArray.shift();
    let subCmd;
 
    if (argArray[0]) {
    E    if (!argArray[0].startsWith('-')) {
            subCmd = argArray.shift();
        }
    }
 
    const c = createRnvConfig({
        command: cmd,
        subCommand: subCmd
    }, { process: true }, cmd, subCmd);
 
 
    argArray.forEach((v, i) => {
        switch (v) {
        case '-p':
            c.platform = argArray[i + 1];
            break;
        case '-t':
            c.target = argArray[i + 1];
            break;
        }
    });
 
    generateBuildConfig(c);
    console.log('JDLKJDKDJL', c.buildConfig);
    c.buildConfig = {
        defaults: {
            supportedPlatforms: ['ios', 'android', 'tizen', 'web', 'macos',
                'webos', 'tizenphone', 'tizenwatch', 'androidtv', 'androidwear',
                'firefoxtv', 'firefoxos']
        },
        defaultTargets: {},
        common: {}
    };
 
    console.log('JDLKJDKDJL2222', c.buildConfig);
    return c;
};