/** @overview nodeunit test case. */

var testResource = require('../../../test_resource'),
    generateClientsideLocaleFiles = require('../../../../task/worker/generate_clientside_locale_files.js');

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

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

exports['Generate clientside locale files.'] = function (test) {
    var workDir = testResource.resolveWorkFile('work_generate_public_locale');
    testResource.prepareCleanWorkDir(workDir, function () {
        generateClientsideLocaleFiles({
            srcDir: testResource.resolveMockFile('mock_locales'),
            destDir: workDir
        }, function (err) {
            test.ifError(err);
            test.done();
        });
    });
};