<commit_before>const assert = require('assert');

const findPackageFileInPath = require('../../lib/utils').findPackageFileInPath;

describe('doxdox util cmd', () => {

    describe('findPackageFileInPath', () => {

        it('findPackageFileInPath without input', () => {

            assert.deepEqual(findPackageFileInPath(), `${process.cwd()}/package.json`);

        });

        it('findPackageFileInPath with input directory', () => {

            assert.deepEqual(findPackageFileInPath('./'), `${process.cwd()}/package.json`);

        });

        it('findPackageFileInPath with input file', () => {

            assert.deepEqual(findPackageFileInPath('./package.json'), `${process.cwd()}/package.json`);

        });

    });

});
<commit_msg>Added test.<commit_after>const assert = require('assert');

const utils = require('../../lib/utils');

describe('doxdox util cmd', () => {

    describe('findPackageFileInPath', () => {

        it('find package without input', () => {

            assert.deepEqual(utils.findPackageFileInPath(), `${process.cwd()}/package.json`);

        });

        it('find package with input directory', () => {

            assert.deepEqual(utils.findPackageFileInPath('./'), `${process.cwd()}/package.json`);

        });

        it('find package with input file', () => {

            assert.deepEqual(utils.findPackageFileInPath('./package.json'), `${process.cwd()}/package.json`);

        });

        it('fail to find package with invalid directory', () => {

            assert.deepEqual(utils.findPackageFileInPath('./testing'), null);

        });

    });

});

{'fraction_non_alphanumeric': 0.1939281288723668, 'fraction_numerical': 0.0, 'mean_word_length': 2.8822115384615383, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 14, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5773881', 'n_tokens_mistral': 461, 'n_tokens_neox': 446, 'n_words': 67}