You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: Add error handling for nonexistent file case with --file option (#5086)
* feat: handle nonexistent files passed to --file
- added error handling when using the --file flag to do it the way
--require does
- added a test to assert that we throw the same type of error
* refactor: remove path.resolve()
- require.resolve() by Node.js follows a Node.js module resolution algo
which includes checking if the resolved path actually exists on the
file system.
* add comment to new code in collect-files.js
* fix: add back absolute path resolving
* refactor: log warning and remove call stack
* revert changes to bin/mocha.js
* improve test case
* throw error and have handler work with it
* change collectFiles to return object
* clean up
* exit mocha immediately on missing file
* new log message
* add tests
* code quality improvements
* add comments
* docs: update to new link name
* pass mocha instance to helper function
---------
Co-authored-by: Pelle Wessman <pelle@kodfabrik.se>
0 commit comments