-
Notifications
You must be signed in to change notification settings - Fork 11
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
feat: Add and export isFilenameValid
function
#951
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
Signed-off-by: Ferdinand Thiessen <[email protected]>
Signed-off-by: Ferdinand Thiessen <[email protected]>
b8edb41
to
8a06891
Compare
Bundle ReportChanges will increase total bundle size by 1.04kB ⬆️
|
Signed-off-by: Ferdinand Thiessen <[email protected]>
}) | ||
|
||
it('works for valid filenames', async () => { | ||
const { isFilenameValid } = await import('../lib/index') |
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.
Why no global import? 🤔
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.
We need to reset the module for every test to reset the cached forbidden characters
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.
Doesn't Vitest have reset module option?
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.
With vi.resetModules()
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.
Doesn't Vitest have reset module option?
Yes see rest of the file, but it can only reset the node cache. So top level imports do not work. It only resets the module cache -> next import will be freshly evaluated.
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.
Why are we always on edge cases 🙈 😭
No description provided.