/** @overview nodeunit test case. */

var testResource = require('../../../test_resource'),
    installBowerComponents = require('../../../../task/worker/install_bower_components.js');

exports.setUp = function (done) {
    process.env.TASK_LOG_DISABLED = true;
    done();
};

exports.tearDown = function (done) {
    process.env.TASK_LOG_DISABLED = false;
    done();
};

exports['Serialize package names.'] = function (test) {
    var series = installBowerComponents._packagesSeries({
        jquery: '~2.1.0'
    });
    test.equal(series.length, 1);
    test.equal(series[0], 'jquery#~2.1.0');
    test.done();
};
//Disable slow tests.
//exports['Install bower components.'] = function (test) {
//    var destDir = testResource.resolveWorkFile('work_install_bower');
//    testResource.prepareCleanWorkDir(destDir, function () {
//        installBowerComponents({
//            packages: {
//                jquery: '~2.1.0'
//            },
//            destDir: destDir
//        }, function (err) {
//            test.ifError(err);
//            test.done();
//        });
//    });
//};