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

Fixes #4665. make "-r <dir>" work with new import-first loading #4668

Merged
merged 1 commit into from
Jun 28, 2021

Conversation

giltayar
Copy link
Contributor

Description of the Change

When falling back on CJS when loading test files, ensure that ERR_UNSUPPORTED_DIR_IMPORT is supported so that -r <cjs-package>/dir will work. See #4665 for a more detailed description.

Benefits

This is a bug fix to return support to what was before enabled.

Possible Drawbacks

None

Applicable issues

#4665

  • Mocha follows semantic versioning: http://semver.org

  • Is this a breaking change (major release)? No

  • Is it an enhancement (minor release)? No

  • Is it a bug fix, or does it not impact production code (patch release)? Yes

@coveralls
Copy link

Coverage Status

Coverage remained the same at 94.369% when pulling a6fd8d7 on giltayar:dir-import-fix into f033ff1 on mochajs:master.

@giltayar giltayar requested a review from juergba June 25, 2021 07:23
@juergba
Copy link
Contributor

juergba commented Jun 25, 2021

@giltayar could there be more cases require can handle, but import doesn't? Requiring json files?

@giltayar
Copy link
Contributor Author

@juergba I can check, but this is only for test files and --require files loaded by mocha, and not for all requires/imports, so I don't think JSON files are relevant, as even if we don't support loading JSON test files, nobody would care.

@juergba juergba added type: bug a defect, confirmed by a maintainer area: node.js command-line-or-Node.js-specific semver-patch implementation requires increase of "patch" version number; "bug fixes" labels Jun 26, 2021
@juergba juergba added this to the next milestone Jun 26, 2021
@juergba juergba linked an issue Jun 26, 2021 that may be closed by this pull request
4 tasks
@juergba juergba added the run-browser-test run browser tests on forked PR if code is safe label Jun 28, 2021
@github-actions github-actions bot removed the run-browser-test run browser tests on forked PR if code is safe label Jun 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: node.js command-line-or-Node.js-specific semver-patch implementation requires increase of "patch" version number; "bug fixes" type: bug a defect, confirmed by a maintainer
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ts-node/register not supported in 9.0.0
4 participants