Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace findup-sync with find-up for faster startup #3830

Merged
merged 2 commits into from Mar 13, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/cli/config.js
Expand Up @@ -9,7 +9,7 @@
*/

const fs = require('fs');
const findUp = require('findup-sync');
const findUp = require('find-up');
const path = require('path');
const debug = require('debug')('mocha:cli:config');

Expand Down Expand Up @@ -72,7 +72,7 @@ exports.loadConfig = filepath => {
* @returns {string|null} Filepath to config, if found
*/
exports.findConfig = (cwd = process.cwd()) => {
const filepath = findUp(exports.CONFIG_FILES, {cwd});
const filepath = findUp.sync(exports.CONFIG_FILES, {cwd});
if (filepath) {
debug(`found config at ${filepath}`);
}
Expand Down
4 changes: 2 additions & 2 deletions lib/cli/options.js
Expand Up @@ -13,7 +13,7 @@ const {ONE_AND_DONE_ARGS} = require('./one-and-dones');
const mocharc = require('../mocharc.json');
const {list} = require('./run-helpers');
const {loadConfig, findConfig} = require('./config');
const findup = require('findup-sync');
const findUp = require('find-up');
const {deprecate} = require('../utils');
const debug = require('debug')('mocha:cli:options');
const {createMissingArgumentError} = require('../errors');
Expand Down Expand Up @@ -255,7 +255,7 @@ const loadPkgRc = (args = {}) => {
return result;
}
result = {};
const filepath = args.package || findup(mocharc.package);
const filepath = args.package || findUp.sync(mocharc.package);
if (filepath) {
try {
const pkg = JSON.parse(fs.readFileSync(filepath, 'utf8'));
Expand Down