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

cleanup mocha implementation #311

Merged
merged 1 commit into from
May 8, 2019
Merged

Conversation

43081j
Copy link
Member

@43081j 43081j commented Feb 3, 2019

So this should help out with fixing up the mocha implementation a bit. Did some refactoring, added support for --reporter and --require in both opts files and scripts.

Wasn't too sure if the tests were good enough so some feedback on them would be appreciated.

If there's anything obvious i've messed up do let me know.

@codecov
Copy link

codecov bot commented Feb 3, 2019

Codecov Report

Merging #311 into master will decrease coverage by 86.04%.
The diff coverage is 97.29%.

Impacted file tree graph

@@             Coverage Diff             @@
##           master     #311       +/-   ##
===========================================
- Coverage   98.39%   12.34%   -86.05%     
===========================================
  Files          32       32               
  Lines         561      583       +22     
===========================================
- Hits          552       72      -480     
- Misses          9      511      +502
Impacted Files Coverage Δ
src/utils/get-scripts.js 80% <100%> (-20%) ⬇️
src/special/mocha.js 97.36% <97.05%> (-2.64%) ⬇️
src/special/babel.js 0% <0%> (-100%) ⬇️
src/check.js 0% <0%> (-100%) ⬇️
src/special/feross-standard.js 0% <0%> (-100%) ⬇️
src/special/eslint.js 0% <0%> (-100%) ⬇️
src/detector/requireResolveCallExpression.js 0% <0%> (-100%) ⬇️
src/detector/gruntLoadTaskCallExpression.js 0% <0%> (-100%) ⬇️
src/detector/exportDeclaration.js 0% <0%> (-100%) ⬇️
src/cli.js 0% <0%> (-100%) ⬇️
... and 21 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update aab8370...a26e113. Read the comment docs.

@codecov
Copy link

codecov bot commented Feb 3, 2019

Codecov Report

Merging #311 into master will increase coverage by 0.05%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #311      +/-   ##
==========================================
+ Coverage   98.47%   98.53%   +0.05%     
==========================================
  Files          32       32              
  Lines         592      613      +21     
==========================================
+ Hits          583      604      +21     
  Misses          9        9
Impacted Files Coverage Δ
src/special/mocha.js 100% <100%> (ø) ⬆️
src/utils/get-scripts.js 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4c54564...8821b0c. Read the comment docs.

@43081j 43081j force-pushed the mocha-cleanup branch 3 times, most recently from 7f358b6 to 4f7773d Compare February 3, 2019 23:56
src/special/mocha.js Show resolved Hide resolved
src/utils/get-scripts.js Show resolved Hide resolved
return null;
}

return fs.readFileSync(path.resolve(root, '..', optsPath), 'utf-8');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if the file does not exist? The exception will break whole parser.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what would be the correct thing to do? if they pass --opts nonexistent, we should throw or error in some way so they know they've tried to pass a non-existent config.

src/special/mocha.js Show resolved Hide resolved
@43081j
Copy link
Member Author

43081j commented Mar 5, 2019

@rumpl mind giving this another quick look? rebased onto master

.map(requirePackageName)
.filter(name => deps.indexOf(name) !== -1);
.filter((v, k, arr) => arr.indexOf(v) === k)
.filter(name => deps.includes(name));
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this seems weird, maybe it shouldn't be here? it was there before but i wasn't sure why...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it reads as if it will filter out any dependencies which aren't in our package.json? don't we want to know about those? i left it in because it was there before but seems pretty questionable.

@rumpl
Copy link
Member

rumpl commented Mar 5, 2019 via email

@rumpl rumpl merged commit f5bf9e7 into depcheck:master May 8, 2019
@43081j 43081j deleted the mocha-cleanup branch May 8, 2019 17:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants