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(jest): avoid haste module naming collision #8754

Merged
merged 1 commit into from
May 8, 2023

Conversation

caugner
Copy link
Contributor

@caugner caugner commented May 3, 2023

Summary

Problem

Running yarn test:kumascript causes the following warnings:

jest-haste-map: Haste module naming collision: @yari-internal/constants
  The following files share their name; please adjust your hasteImpl:
    * <rootDir>/libs/constants/package.json
    * <rootDir>/cloud-function/src/internal/constants/package.json

jest-haste-map: Haste module naming collision: @yari-internal/env
  The following files share their name; please adjust your hasteImpl:
    * <rootDir>/libs/env/package.json
    * <rootDir>/cloud-function/src/internal/env/package.json

jest-haste-map: Haste module naming collision: @yari-internal/fundamental-redirects
  The following files share their name; please adjust your hasteImpl:
    * <rootDir>/libs/fundamental-redirects/package.json
    * <rootDir>/cloud-function/src/internal/fundamental-redirects/package.json

jest-haste-map: Haste module naming collision: @yari-internal/languages
  The following files share their name; please adjust your hasteImpl:
    * <rootDir>/libs/languages/package.json
    * <rootDir>/cloud-function/src/internal/languages/package.json

jest-haste-map: Haste module naming collision: @yari-internal/locale-utils
  The following files share their name; please adjust your hasteImpl:
    * <rootDir>/libs/locale-utils/package.json
    * <rootDir>/cloud-function/src/internal/locale-utils/package.json

jest-haste-map: Haste module naming collision: @yari-internal/slug-utils
  The following files share their name; please adjust your hasteImpl:
    * <rootDir>/libs/slug-utils/package.json
    * <rootDir>/cloud-function/src/internal/slug-utils/package.json

jest-haste-map: Haste module naming collision: @yari-internal/types
  The following files share their name; please adjust your hasteImpl:
    * <rootDir>/libs/types/package.json
    * <rootDir>/cloud-function/src/internal/types/package.json

jest-haste-map: Haste module naming collision: @yari-internal/pong
  The following files share their name; please adjust your hasteImpl:
    * <rootDir>/libs/pong/package.json
    * <rootDir>/cloud-function/src/internal/pong/package.json

Solution

Scope yarn test:kumascript to the kumascript folder with the (undocumented) --rootDir option (which we have already been using for yarn test:testing).


How did you test this change?

✅ The warnings no longer appear in the workflow run in this PR.

@caugner caugner changed the title fix(jest): use --rootDir option fix(jest): avoide haste module naming collision May 3, 2023
@caugner caugner changed the title fix(jest): avoide haste module naming collision fix(jest): avoid haste module naming collision May 3, 2023
@caugner caugner force-pushed the fix-jest-haste-warning branch from b51e366 to 1000a50 Compare May 3, 2023 21:46
@caugner caugner force-pushed the fix-jest-haste-warning branch from 1000a50 to 8a32053 Compare May 4, 2023 11:54
@caugner caugner force-pushed the fix-jest-haste-warning branch from 8a32053 to c546b09 Compare May 4, 2023 13:41
@caugner caugner requested a review from fiji-flo May 4, 2023 14:07
Copy link
Contributor

@fiji-flo fiji-flo left a comment

Choose a reason for hiding this comment

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

💯

@fiji-flo fiji-flo merged commit 80f51f4 into main May 8, 2023
@fiji-flo fiji-flo deleted the fix-jest-haste-warning branch May 8, 2023 14:19
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