Skip to content
This repository has been archived by the owner on May 22, 2024. It is now read-only.

fix: adapt to new node:test module in node 18 #1069

Merged
merged 4 commits into from
Apr 21, 2022
Merged

Conversation

Skn0tt
Copy link
Member

@Skn0tt Skn0tt commented Apr 21, 2022

πŸŽ‰ Thanks for submitting a pull request! πŸŽ‰

Summary

Fixes tests on main. Read my PR to precinct upstream for more info: dependents/node-precinct#108

Until precinct is fixed upstream, this PR fixes it on our end.


For us to review and ship your PR efficiently, please perform the following steps:

  • Open a bug/issue before writing your code πŸ§‘β€πŸ’».
    This ensures we can discuss the changes and get feedback from everyone that should be involved. If you`re fixing
    a typo or something that`s on fire πŸ”₯ (e.g. incident related), you can skip this step.
  • Read the contribution guidelines πŸ“–. This ensures your code follows our style guide and
    passes our tests.
  • Update or add tests (if any source code was changed or added) πŸ§ͺ
  • Update or add documentation (if features were changed or added) πŸ“
  • Make sure the status checks below are successful βœ…

A picture of a cute animal (not mandatory, but encouraged)

@Skn0tt Skn0tt added the type: bug code to address defects in shipped code label Apr 21, 2022
@@ -87,6 +88,19 @@ const getDependencies = async function ({
}
}

const paperwork = async (path: string) => {
const modules = await precinct.paperwork(path, { includeCore: true })
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I understand correctly, by using includeCore: true instead of includeCore: false, we're taking over the job of filtering the core modules, which you're doing with isBuiltinModule. I see the precinct seems to use a different detection mechanism, though.

Is there a risk this will cause regressions, with some modules suddenly being evaluated differently?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that's a good point - we should stick to process.binding if possible. isBuiltinModule is using a similar mechanism under the hood, but there could be subtle differences ...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done in c75179f

@@ -87,6 +88,19 @@ const getDependencies = async function ({
}
}

const paperwork = async (path: string) => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add a comment explaining that we're temporarily adding a step between us and precinct because of a specific issue?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done in c75179f

Copy link
Member

@eduardoboucas eduardoboucas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

πŸš€ πŸŒ•

@Skn0tt Skn0tt merged commit 1ffe7c1 into main Apr 21, 2022
@Skn0tt Skn0tt deleted the fix-node-18-tests branch April 21, 2022 17:10
@Skn0tt Skn0tt mentioned this pull request May 9, 2022
Skn0tt added a commit to netlify/build that referenced this pull request May 21, 2024
…p-it#1069)

* fix: adapt to new node:test module in node 18

* chore: add comment and use process.binding to replicate paperwork

* fix: replicate even more precise

* refactor: use precinct's mechanism for sub v18
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: bug code to address defects in shipped code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants