Skip to content

Commit

Permalink
Use path.join in place of string templates.
Browse files Browse the repository at this point in the history
  • Loading branch information
neogeek committed May 19, 2017
1 parent a7b9e2a commit 31d5504
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions test/specs/utils.js
@@ -1,4 +1,5 @@
const assert = require('assert');
const path = require('path');

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

Expand All @@ -8,25 +9,25 @@ describe('doxdox utils', () => {

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

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

});

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

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

});

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

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

});

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

assert.equal(utils.findPackageFileInPath('./index.js'), `${process.cwd()}/package.json`);
assert.equal(utils.findPackageFileInPath('./index.js'), path.join(process.cwd(), 'package.json'));

});

Expand Down

0 comments on commit 31d5504

Please sign in to comment.