-
Notifications
You must be signed in to change notification settings - Fork 29.7k
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
policy tests fail if there is a package.json in parent directories #35600
Comments
@jasnell this is intentional since that is how policies work, the CJS/ESM loaders crawl up to find "type" from package.json files and if it finds one that isn't allowed it fails. Is there some issue that needs to be fixed? |
Yes, I get that, it's just unexpected for the test suite to fail due to some factor completely outside of the project repo. Ideally there would be a way of sandboxing it or limiting the search path... or, if that's not possible, to provide a better error that describes why it's failing. |
we could also just put a well known package.json in the test directory |
Good idea. I'm on it. |
Actually, I don't understand what needs to be changed to make it work, feel free to pick it up 😄 . |
Policy tests can fail if a `package.json` exists in any of the parent directories above the test. The existing checks are done for the ancestors of the test directory but some tests execute from the tmpdir. PR-URL: #38285 Refs: #38088 Refs: #35600 Refs: #35633 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Policy tests can fail if a `package.json` exists in any of the parent directories above the test. The existing checks are done for the ancestors of the test directory but some tests execute from the tmpdir. PR-URL: #38285 Refs: #38088 Refs: #35600 Refs: #35633 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Policy tests can fail if a `package.json` exists in any of the parent directories above the test. The existing checks are done for the ancestors of the test directory but some tests execute from the tmpdir. PR-URL: #38285 Refs: #38088 Refs: #35600 Refs: #35633 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Policy tests can fail if a `package.json` exists in any of the parent directories above the test. The existing checks are done for the ancestors of the test directory but some tests execute from the tmpdir. PR-URL: #38285 Refs: #38088 Refs: #35600 Refs: #35633 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Policy tests can fail if a `package.json` exists in any of the parent directories above the test. The existing checks are done for the ancestors of the test directory but some tests execute from the tmpdir. PR-URL: #38285 Refs: #38088 Refs: #35600 Refs: #35633 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Just opening this so it's not forgotten.... Policy tests can fail if there is a package.json in the parent path of the local node.js repo
What steps will reproduce the bug?
How often does it reproduce? Is there a required condition?
What is the expected behavior?
What do you see instead?
Additional information
The text was updated successfully, but these errors were encountered: