-
Notifications
You must be signed in to change notification settings - Fork 3
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
test: Reimplement the Unit Test "requires" #248
Conversation
/* eslint-disable import/no-dynamic-require */ | ||
/* eslint-disable n/global-require */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test requires dynamic require
, so disable the rules for this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Delete this file as it's no longer used.
The reimplemented Unit Test revealed that it was unnecessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Delete this file as it's no longer used.
The reimplemented Unit Test revealed that it was unnecessary.
dirs.forEach((dir) => { | ||
files = readdirRecursively(dir, files); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the processing on L10 is canceled here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🙆♂️
* implement `requires` test * lint test files
Summary
The existing Unit Test
/tests/requires.test.js
wasn't working properly, so I reimplemented it.This test collects the paths of JavaScript files under the specified directory and checks whether they can be loaded correctly (they can be worked
require
).However, when I ran the test, I found that it wasn't being collected at all. This was caused by an incorrect implementation of the recursive function, and this was corrected to make it work correctly.
Other
Introduced
eslint-config-prettier
to properly format test code with ESLint and Prettier.References