/** @overview nodeunit test case. */

var testResource = require('../../../test_resource'),
    linkNpmPackage = require('../../../../ci/worker/link_npm_package.js');

exports.setUp = function (done) {
    done();
};

exports.tearDown = function (done) {
    done();
};


exports['Find up a package.'] = function (test) {
    var found = linkNpmPackage._findup('__never_exists__');
    test.ifError(found);
    found = linkNpmPackage._findup(testResource.resolveMockFile('mock-Apemanfile.js'));
    test.ok(found);
    test.done();
};

exports['No found.'] = function (test) {
    linkNpmPackage({
        packageName: 'foo/bar/baz'
    }, function (err) {
        test.ok(err);
        test.done();
    })
};