Skip to content
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

fix for node 16.12 and higher #4

Merged
merged 1 commit into from
Oct 27, 2021
Merged

fix for node 16.12 and higher #4

merged 1 commit into from
Oct 27, 2021

Conversation

bengl
Copy link
Member

@bengl bengl commented Oct 27, 2021

Node 16.12.0 and higher replaces the getSource and getFormat hooks
with a load hook. This has now been added, calling into the
getSource hook in order to not duplicate its complexity.

There's no need for a separate test, but eventually some mechanism of
testing all supported Node.js versions and collecting the coverage data
will be required, since not all lines are now covered on every Node.js
version.

Node 16.12.0 and higher replaces the `getSource` and `getFormat` hooks
with a `load` hook. This has now been added, calling into the
`getSource` hook in order to not duplicate its complexity.

There's no need for a separate test, but eventually some mechanism of
testing all supported Node.js versions and collecting the coverage data
will be required, since not all lines are now covered on every Node.js
version.
@@ -4,7 +4,7 @@
"description": "Intercept imports in Node.js",
"main": "index.js",
"scripts": {
"test": "c8 --check-coverage --lines 100 imhotap --runner test/runtest --files test/{hook,low-level}/*.*js",
"test": "c8 --check-coverage --lines 90 imhotap --runner test/runtest --files test/{hook,low-level}/*.*js",
Copy link
Contributor

Choose a reason for hiding this comment

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

Checking coverage could be moved to a separate job that checks on the merged result and still achieve 100%. Not a blocker but it would avoid coverage going down over time.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah this needs a proper setup with codecov (or similar tool) but that I can do in another PR.

@bengl bengl merged commit 6a89b92 into main Oct 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants