fix(extract): also detects node:test as a core module #822
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
node:test
is detected as a core moduleMotivation and Context
Currently
node:test
dependencies are classified as unable to resolve. This is becausenode:test
ortest
are not listed asbuiltinModules
in node'smodule
module. From the discussion on nodejs/node#42785 I understand this is never going to happen either. Alternative is to usemodule
'sisBuiltin()
function, but that is not available in the lowest version of nodejs dependency-cruiser supports (16.14), so we have to work around that.Additionally the
node:test
module can only be required via thenode:
protocol (const { test} = require('test')
/import { test } from 'test'
don't work). This means that with the current the way we split the protocol from the module name, usingisBuiltin
won't work either...How Has This Been Tested?
Types of changes
Checklist
📖
⚖️