-
Notifications
You must be signed in to change notification settings - Fork 786
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
no redeclaration of reserved __dirname #809
Conversation
Hi there 👋 Can you provide the error logs you get (+ jest version)? We use jest for unit tests and do not have any issues with it. |
We currently use version I guess jest can be configured in a lot of ways. I see no reason to fight against it if avoidable. Here is the error message:
I think it is because it converts the module to CommonJS. This is what the node manual says:
So since they are set 'in scope' you cannot redeclare them. I tried this with a minimal test file const __dirname = 1; $ node test.js
/Volumes/SourceCode/test.js:1
const __dirname = 1;
^
SyntaxError: Identifier '__dirname' has already been declared |
Any blockers to merge this? |
@vlinder & @xenova this is also blocking drizzle-kit from completing successfully.
|
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.
Apologies for the delay - PR looks good!
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
Running
jest
with this package crashes because of redeclaration of reserved keyword__dirname
.This PR renames it to
dirname__
.